registry.module.apply ​
Validate, persist and compile an app module descriptor
Validate + persist a module descriptor and compile it into the governance registries (GOV-9, idempotent atomic compile).
Inputs: actor, organization_uuid, identity_app_uuid, slug (required); title, feature_flag, plan_gate, capabilities (list), audit_events (list), descriptor (object), dry_run (bool) optional. In one transaction keyed by plan_hash the apply persists the module row, upserts the feature-flag registry (descriptor.featureFlag), and compiles the capability catalog (descriptor.capabilities ∪ derived vw/data/document caps), the route registry (descriptor.routes) and the audit-event registry (descriptor.auditEvents ∪ the audit_events input) — all five stores in one atomic write. dry_run=true computes the plan and writes nothing. Outputs: slug, feature_flag, plan_gate, capabilities (the compiled catalog set), audit_events, plan_hash, created, version, dry_run, compiled (per-registry summary). Re-applying an unchanged descriptor is stable (same plan_hash, no dupes).
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-policy |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
actor | string | Yes | — | — |
organization_uuid | uuid | Yes | — | — |
identity_app_uuid | uuid | Yes | — | — |
slug | string | Yes | — | — |
title | string | No | — | — |
feature_flag | string | No | — | — |
plan_gate | string | No | — | — |
capabilities | list | No | — | — |
audit_events | list | No | — | — |
descriptor | dict | No | — | — |
dry_run | boolean | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
slug | string | No | — | — |
feature_flag | string | No | — | — |
plan_gate | string | No | — | — |
capabilities | list | No | — | — |
audit_events | list | No | — | — |
plan_hash | string | No | — | — |
created | boolean | No | — | — |
version | integer | No | — | — |
dry_run | boolean | No | — | — |
compiled | dict | No | — | — |
identity_app_uuid | uuid | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_layer | string | No | — | — |
failed_step | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
reason | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "registry.module.apply",
"initial_data": {
"actor": "value",
"organization_uuid": "value",
"identity_app_uuid": "value",
"slug": "value"
}
}