# Praxis Form Schema Runtime Modes

> Use when Codex must work on @praxisui/dynamic-form or praxis-dynamic-form package schema-driven runtime inputs, resourcePath, schemaUrl, readUrl, submitUrl, submitMethod, create/edit/view/presentation/dossier modes, volatile governed-page execution, standalone config persistence, initialValue hydration, selection-driven entity loading, stale detail values, local error/retry feedback and focus, metadata hot updates, layoutPolicy mode effects, or runtime contract reconciliation.

- Skill: `codexrodrigues/praxis-form-schema-runtime-modes` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add codexrodrigues/praxis-form-schema-runtime-modes`
- Raw SKILL.md: https://api.skillmd.com/api/skills/codexrodrigues/praxis-form-schema-runtime-modes/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: codexrodrigues (https://skillmd.com/u/codexrodrigues)
- Updated: 2026-11-15
- Page: https://skillmd.com/skills/codexrodrigues/praxis-form-schema-runtime-modes

---


# Praxis Form Schema Runtime Modes

This `praxis-form-*` skill family is the canonical Codex skill surface for `@praxisui/dynamic-form` and `projects/praxis-dynamic-form`; do not create parallel `praxis-dynamic-form-*` guidance unless this family cannot express a proven contract gap.

Use this skill for the runtime contract that turns backend metadata and host inputs into a live `PraxisDynamicForm`. The form runtime is the Angular materialization owner; backend schema semantics remain canonical in `praxis-metadata-starter`, and config persistence remains canonical in `praxis-config-starter`.

## Source Audit

Inspect the real runtime before editing:

- `projects/praxis-dynamic-form/AGENTS.md`
- `projects/praxis-dynamic-form/src/public-api.ts`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.ts`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.spec.ts`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.resource-isolation.spec.ts`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.json-api.md`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.metadata.ts`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.metadata.spec.ts`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.external-config-hydration.spec.ts`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.first-config-hydration.spec.ts`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.field-metadata-roundtrip.spec.ts`
- `projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.layout-policy.spec.ts`
- `projects/praxis-dynamic-form/src/lib/services/form-config.service.ts`
- `projects/praxis-dynamic-form/src/lib/services/form-config.service.spec.ts`
- `projects/praxis-dynamic-form/src/lib/services/form-context.service.ts`
- `projects/praxis-dynamic-form/src/lib/services/form-context.service.spec.ts`
- `projects/praxis-dynamic-form/src/lib/services/dynamic-form-layout.service.spec.ts`
- `projects/praxis-dynamic-form/src/lib/services/form-layout.service.spec.ts`
- `projects/praxis-dynamic-form/docs/hot-metadata-updates.md`
- `projects/praxis-dynamic-form/docs/schema-driven-layout-materialization-rfc.md`
- `projects/praxis-dynamic-form/docs/dynamic-form-authoring-document-semantics.md`

Also inspect these `@praxisui/core` resource/schema services when the behavior depends on `resourcePath`, operation schemas, capabilities, action links, surfaces, read projections, or option sources:

- `projects/praxis-core/src/lib/models/resource-discovery.model.ts`
- `projects/praxis-core/src/lib/models/resolved-crud-operation.model.ts`
- `projects/praxis-core/src/lib/services/crud-operation-resolution.service.ts`
- `projects/praxis-core/src/lib/services/crud-operation-resolution.service.spec.ts`
- `projects/praxis-core/src/lib/services/resource-action-open-adapter.service.ts`
- `projects/praxis-core/src/lib/services/resource-action-open-adapter.service.spec.ts`
- `projects/praxis-core/src/lib/services/resource-surface-open-adapter.service.ts`
- `projects/praxis-core/src/lib/services/resource-surface-open-adapter.service.spec.ts`
- `projects/praxis-core/src/lib/services/surface-open-materializer.service.ts`
- `projects/praxis-core/src/lib/services/surface-open-materializer.service.spec.ts`
- `projects/praxis-core/src/lib/services/generic-crud.service.ts`
- `projects/praxis-core/src/lib/services/schema-normalizer.service.spec.ts`

## Runtime Contract

Separate these inputs before changing behavior:

- `resourcePath`: base resource contract resolved by Praxis services; do not include `/api`, `/filter`, item ids, or operation URLs.
- `schemaUrl`: explicit schema endpoint; use when a host intentionally bypasses resource-derived schema resolution.
- `readUrl`: explicit entity read endpoint; placeholders require a resource id.
- `submitUrl` + `submitMethod`: canonical explicit submit pair. Do not configure one without the other.
- `responseSchemaUrl`: diagnostic/read-only response contract, not a source for editable command fields.
- `apiEndpointKey` and `apiUrlEntry`: origin resolution inputs for detached overlays/dialogs; do not hardcode API origins in consumers.
- `mode`: Core `DynamicFormMode` accepts `create`, `edit`, `view`, `presentation`, and `dossier`. It does not choose whether customization UI is enabled; preserve the complete union through native authoring and preference hydration.
- `initialValue`: create-mode seed or host-provided patch; it must not redefine schema semantics.

For metadata-driven flows, prefer `/schemas/filtered` request/response schemas and operation-aware metadata over host-authored field lists. If table/list works but form fails, inspect id field, schema operation, and resource metadata before adding frontend aliases.

Keep these runtime rules explicit:

- Each `<praxis-dynamic-form>` owns its mutable `GenericCrudService` and `FormContextService` instances. Sibling forms must not overwrite another form's resource, schema cache, available fields, or rules; prove isolation with `praxis-dynamic-form.resource-isolation.spec.ts`.
- This is a breaking-beta migration from shared DI: an ancestor replacement or subclass of `GenericCrudService` is no longer used by Dynamic Form. Do not describe that previously supported replacement path as if it had never existed.
- Configure the Form through `resourcePath`, `apiEndpointKey`, `apiUrlEntry`, and direct Form `customEndpoints`; these inputs do not reproduce custom logic from an ancestor service replacement. `HttpClient` and its interceptors, `GlobalConfigService`, and `API_URL` remain inherited from the host injector.
- In Form tests, override the component-local mock with `TestBed.overrideComponent(PraxisDynamicForm, { add: { providers: [{ provide: GenericCrudService, useValue: crudMock }] } })`; mock `FormContextService` there when needed. Use `add` so the Form's i18n provider remains installed.
- Schema-backed initialization requires `formId` and either `resourcePath` or `schemaUrl`. Local-only forms may render from explicit local `config`; a standalone form with `formId` also participates in configuration persistence without a schema request. Without an ID, standalone configuration remains host-owned.
- `resourcePath` remains the owner resource path. `schemaUrl`, `readUrl`, `submitUrl`, and `responseSchemaUrl` are concrete operation/surface URLs published by discovery or supplied explicitly.
- Explicit component inputs have precedence over persisted connection/input preferences. Persisted connection can hydrate `resourcePath` only when the host did not provide one.
- `schemaUrl` can initialize schema-backed runtime without `resourcePath`, but command/read/submit behavior still needs the correct operation URLs and resource identity when applicable.
- `readUrl` replaces `crud.getById(...)` for item read surfaces and read projections; when absent, entity hydration falls back to `resourcePath` + `resourceId`; when both are absent, `initialValue` may hydrate local entity state.
- `initialValue` is a runtime value seed or materialized read-projection payload. It must not be used to define fields, validators, option sources, actions, layout ownership, or backend semantics.
- `domainRules` is a runtime materialization input. It may combine governed `form_config`
  projections with `config.formRules`, but it must not be treated as authored local config or
  serialized into the editor document during schema/mode reconciliation.
- External `config` updates must rebuild/reconcile with server schema without erasing canonical schema-backed metadata. Preserve explicit local fields, but refresh server-backed field semantics from schema.
- Schema status, server hash, ETag, `X-Schema-Hash`, and outdated warnings are diagnostics/governance for drift; do not turn them into local schema forks.
- Runtime/discovery values such as `schemaUrl`, `submitUrl`, and `submitMethod` may be displayed in authoring as read-only diagnostics, but must not be persisted into `DynamicFormAuthoringDocument` bindings or context snapshots.
- Core `ResourceSurfaceOpenAdapterService` and `ResourceActionOpenAdapterService` should materialize widget inputs for schema/read/submit URLs, API origin, mode, form id, and resource id/bindings. Fix these adapters or metadata discovery when surfaces open with incorrect runtime inputs.
- Core `SurfaceOpenMaterializerService` may materialize read projections into Dynamic Form `initialValue` plus transient schema layout policy; this is a runtime projection, not authored local config.
- When a surface/action materializes `schemaUrl`, `readUrl`, `submitUrl`, `submitMethod`,
  `apiEndpointKey`, `apiUrlEntry`, `mode`, `resourceId`, `initialValue`, `domainRules`, or
  transient `layoutPolicy`, prove the adapter/materializer produced the right runtime inputs before
  adding host-side defaults. Do not patch a migrated screen by hardcoding operation URLs or copying
  generated layout into `FormConfig.sections`.

## Standalone Configuration Persistence

Use the existing `initializeForm` lane for an identified standalone form with
renderable host configuration. `local-first` restores the mode-scoped saved
document; `input-first` keeps the latest host document authoritative. Transient
layout policy skips loading persisted configuration. Do not invent a resource
path, schema endpoint, or parallel persistence adapter for local fields.

Inspect input hydration, storage and mode changes as one asynchronous flow. Resolve
host precedence after the storage read, including a host document cleared while
the read was pending. An empty standalone document must not fall through to schema
generation. If the mode-scoped key changed during the read, discard that response
and initialize the current key after releasing the loading guard. A late response
after destruction must not rebuild or resume the destroyed view.

Prove saved, missing and failed storage reads, `input-first`, transient policy,
no-ID standalone and disconnected empty state. Include delayed reads with a newer
host document, a cleared document, a mode switch and destruction. Check declared
initialization hooks and pending entity inputs when those paths are affected;
sharing an initializer must preserve their lifecycle without adding schema calls.
Use `praxis-dynamic-form.field-metadata-roundtrip.spec.ts` as the focused regression
entrypoint, plus a real storage reload when authoring persistence is the reported
failure. A mocked accepted patch alone does not prove Save survives reopening.

Exercise host replacements through `fixture.componentRef.setInput('config', value)`
and change detection with documents already normalized by the Form helper. Angular
assigns the new input before `ngOnChanges`; compare the previous host document
(`SimpleChange.previousValue`) when detecting change, rather than treating the
already-assigned component property as the previous document. Directly calling
`ngOnChanges` without Angular's assignment can miss this regression.

For a `local-first` form, let saved configuration load, hold its first `afterInit`
hook, then supply a different normalized host document and release the hook.
Assert that the latest fields remain authoritative and initialization succeeds.
Use cold storage that returns the old saved document on every subscription, and
assert one form-config read: a retry must not replay that document over the update.
Separately, in a settled `input-first` standalone form, prove a real replacement
rebuilds while preserving surviving controls' dirty values, an equivalent clone
of the current document avoids a rebuild, and an explicit empty replacement
removes the old controls. These local-field cases must not request schema or save
configuration merely because an input changed.

Distinguish an equivalent host echo from the effective document selected by
`local-first`: the opening host document can differ from the loaded saved one.
Prove echoes of that opening document after initialization and during `afterInit`
retain the saved metadata, both saved rule effect branches and dirty control values,
without rebuilding or rereading configuration. Keep one effective runtime document;
any pre-assignment observation is transient lifecycle bookkeeping, not a parallel
configuration contract. An echo alone must not invalidate initialization ownership;
changes to mode, identity or resource still require their existing fences.

Cover two `setInput` assignments before one change-detection pass: the local-first
case ending in an opening-document echo preserves the effective saved document;
the separate input-first case ending in a genuine replacement rebuilds once from
that final document. A manual equivalent `ngOnChanges` call without a corresponding
input assignment must not restore an older internal document. Inspect the existing
schema-backed echo test too: its reconciliation/verification spies prove local
ownership and no redundant rebuild, not live schema HTTP or identity-switch
behavior. Do not claim settled owner-switch coverage from these cases.

## Remote Selection, Loading And Recovery

Read `projects/praxis-dynamic-form/docs/entity-read-feedback.md`, the runtime
`loadEntity`/`retryEntityRead` implementation, template and i18n, and
`projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.entity-selection.spec.ts`.
These states belong to Dynamic Form. Existing `resourceId` and loading events
already carry the integration; do not create a host overlay, new loading input,
or connection-editor option to hide outdated values.

- Audit pending, failed, superseded, cleared and successful reads independently.
  Keep mounted controls and geometry while hiding the previous body with zero
  opacity, no transition, `inert` and `aria-hidden` during pending or failure.
  An opacity fade still exposes two identities; assert computed opacity zero
  immediately after selection even when a host supplies an opacity transition.
  `visibility:hidden` alone is insufficient when descendants override visibility.
- Keep local status outside the busy form. Use the stable live region and the
  existing localized loading/error/retry/success text, avoiding duplicated speech.
  A page-top loading bar is not sufficient feedback for a detail region.
- Failed or invalid reads must keep body and submit blocked. Explicit retry
  invalidates read deduplication and focuses the stable detail region. Neither
  automatic selection nor a later response may steal focus from another control.
- Remote success replaces the snapshot using `form.reset(normalized)`, clearing
  fields omitted by the new response. Cancel superseded reads and block submit
  after identity changes, including changes during async hooks. Preserve create
  and authoritative local `initialValue` behavior; do not replace those with
  remote selection semantics.
- Use existing `emptyState` for selection guidance when applicable. Header
  name/photo formatting belongs to Core composition; it does not replace the
  form's loading/error state or require a new avatar-specific connection.

Run the entity-selection spec for A→B pending, B failure/retry, partial/invalid
responses, B arriving after C, clearing while pending, submit guards and focus
after keyboard retry. For visual proof, the official `/dynamic-page-lab` includes
`form-entity-read-proof.component.ts` with explicit completion/failure controls.
Separate this deterministic local fixture from real API evidence. Inspect desktop
and narrow width, first-frame hiding, accessible tree and keyboard focus; do not
claim screen-reader certification from DOM assertions alone.

No new editor control, manifest operation or public API is required for this
internal feedback materialization. Reassess derived artifacts only when the
actual public surface changes, and record the decision.

## Mode And Presentation Rules

- `view` is read-only by data lifecycle. `readonlyModeGlobal` can also force read-only behavior.
- `presentationModeGlobal=true` is only effective in `view`; edit/create should render input mode.
- Explicit `presentation` and `dossier` modes also activate presentation; `dossier` selects the corporate dossier preset when no explicit preset overrides it. Check `effectivePresentation`, `effectivePresentationPreset` and mode-key persistence in the Form owner. Recommend `view` plus presentation options where appropriate without silently normalizing existing five-mode documents. Filter Form retains its three-mode subset.
- `layoutPolicy.source="schema"` is explicit opt-in for schema-owned layout.
- `intent="detail"` plus `preset="compactPresentation"` belongs to read-only detail summaries.
- `intent="command"` plus grouped command layout belongs to create/edit command forms.
- Command forms must use request schema metadata. Rendering create/edit from response/detail schema is a contract defect, because derived/read-only fields can become editable.
- Detail/read-only summaries should use response schema metadata and may request presentation through `layoutPolicy.intent="detail"` or `preset="compactPresentation"` while keeping `presentationModeGlobal=false` available for traditional readonly controls.
- `layoutPolicy.persistence="transient"` prevents generated schema layout from being persisted as authored local sections. Prefer this for schema-driven command/detail materialization unless the user explicitly detaches/authorizes a layout.
- In Ergon-style migrations, choose the schema mode from the operation contract first: detail/view
  uses response schema and read URL; create/edit commands use request schema plus the explicit
  submit URL/method. If a command form needs local field filtering, label correction, option mapping,
  or disabled/read-only fixes, treat that as metadata/request-schema debt before adding Dynamic Form
  aliases or local `sections`.
- External `config` or metadata updates must rebuild or reconcile the runtime without erasing canonical schema-backed metadata.

Do not create `FormConfig.sections` or `sections: []` merely to make a schema-driven form initialize. If generated layout is weak, classify the gap and fix metadata/runtime materialization.

Resolve Reactive Determinations from the actual operation/form mode metadata.
The runtime may debounce, cancel stale work, apply declared outputs, and emit
sanitized diagnostics, but it must not select a determination by field names or
execute a local business formula. Pair definition/binding or race changes with
`praxis-reactive-determinations`.

## Governed Page Execution

For page-governed Form execution, inspect
`dynamic-form-page-widget-adapter.ts` and the runtime's
`configPersistenceStrategy: 'volatile'` paths. Use
`materializeDynamicFormPageRuntimeInputs` to derive the Core page/widget identity
and runtime-only persistence/editor flags; never save these inputs into page
authorship. Volatile execution uses explicit config and native defaults, without
independent form preferences, presentation/back-navigation/connection keys or
personal global schema-preference overlays. Preserve explicit zero/false values.

Audit every storage load/save/clear and asynchronous completion, including Reset,
schema update prompts and preference hydration. Bind stale-response guards to the
ownership and actual key of the resource: legitimate connection/mode hydration
must not cancel unrelated widget preferences. When a host change invalidates a
pending read, ensure the current context receives a replacement when needed.
Prove both valid response orders as well as identity changes, A-to-volatile-to-A,
errors and destruction; rejecting every late response is not sufficient. Prove behavior with conflicting
personal storage and real global config changes. Shared GlobalConfigService may
still load its infrastructure state; do not claim zero global I/O or replace the
service with a stub as proof of no personal influence. Tenant, cache, locale and
CSP remain host infrastructure, not page-authored configuration. The adapter
does not itself prove published routes or the later host integration.

## Aderence Inventory

Before creating any input, config key, endpoint convention, or public export, classify the need:

- `ja-suportado-so-ux`
- `ja-suportado-mal-nomeado-ou-mal-materializado`
- `suportado-parcialmente`
- `lacuna-real-de-contrato`

Most schema/mode issues are already supported by runtime inputs, schema metadata, `layoutPolicy`, `initialValue`, or authoring snapshots. Only add a contract when the behavior cannot be expressed by those canonical surfaces.

## Validation

Start with focused Dynamic Form runtime specs:

```bash
npx ng test praxis-dynamic-form --watch=false --progress=false \
  --include=projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.spec.ts \
  --include=projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.metadata.spec.ts
```

For hydration, persisted config, runtime context, or `initialValue` behavior:

```bash
npx ng test praxis-dynamic-form --watch=false --progress=false \
  --include=projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.field-metadata-roundtrip.spec.ts \
  --include=projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.external-config-hydration.spec.ts \
  --include=projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.first-config-hydration.spec.ts \
  --include=projects/praxis-dynamic-form/src/lib/services/form-context.service.spec.ts \
  --include=projects/praxis-dynamic-form/src/lib/services/form-config.service.spec.ts
```

For schema layout policy, presentation mode, or generated layout behavior:

```bash
npx ng test praxis-dynamic-form --watch=false --progress=false \
  --include=projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.layout-policy.spec.ts \
  --include=projects/praxis-dynamic-form/src/lib/services/dynamic-form-layout.service.spec.ts \
  --include=projects/praxis-dynamic-form/src/lib/services/form-layout.service.spec.ts
```

For schema/read/submit inputs materialized by resource surfaces/actions or CRUD operation resolution:

```bash
npx ng test praxis-core --watch=false --progress=false \
  --include=projects/praxis-core/src/lib/services/crud-operation-resolution.service.spec.ts \
  --include=projects/praxis-core/src/lib/services/resource-action-open-adapter.service.spec.ts \
  --include=projects/praxis-core/src/lib/services/resource-surface-open-adapter.service.spec.ts \
  --include=projects/praxis-core/src/lib/services/surface-open-materializer.service.spec.ts
```

For schema normalization or option metadata that feeds runtime forms:

```bash
npx ng test praxis-core --watch=false --progress=false \
  --include=projects/praxis-core/src/lib/services/schema-normalizer.service.spec.ts
```

For public input/export changes, run `npm run build:praxis-dynamic-form` and a direct consumer build when applicable. Use browser validation when mode, presentation, schema-driven layout, or metadata hot update changes visible UX.

State explicitly when live API/browser validation was skipped.

## Companion Skills

- Use `praxis-reactive-determinations` for governed rule/snapshot, metadata compiler, host resolver, and HTTP proof.

- Use `praxis-form-submit-payload-pipeline` for payload normalization and local/transient submit semantics.
- Use `praxis-form-layout-canvas` for `layoutPolicy`, visual blocks, generated presets, and canvas/editor placement.
- Use `praxis-form-editor-document-roundtrip` when runtime inputs are exposed through Settings Panel or authoring documents.
- Use `praxis-fields-runtime-loader` when a schema-backed `controlType` does not render or hot metadata does not reach the field component.
- Use `praxis-fields-option-sources` and `praxis-fields-selection-lookup-controls` when schema metadata materializes `optionSource`, async select, entity lookup, or selection controls.
- Use `praxis-core-resource-runtime` for schema/resource discovery, capabilities, actions, and option sources.
- Use `praxis-metadata-schema-contracts` when `/schemas/filtered`, `schemaUrl`, `schemaId`, `x-ui`, `idField`, `readOnly`, ETag, or `X-Schema-Hash` are missing, stale, or contradictory.
- Use `praxis-metadata-domain-option-sources` when schema-backed option sources, field access, domain governance, entity lookup publication, or by-ids reload are missing or contradictory.

