KB-A881

Process/Workflow Axis RP Pilot — 08 UI/API Contract

3 min read Revision 1
process-axisui-apidrilldown2026-06-04

08 — UI/API Process Drilldown Contract

PATCH-READY. UI source is outside the MCP read allowlist → this is a packet; Nuxt redeploy is operator-gated. No Nuxt-side math (PG returns all counts/status/depth per layer-definition canon).

Routes (mirror the live /axes + /registries-pivot pattern)

method route backing object
GET /api/axes/AX-PROCESS axis_registry row + pivots_ref
GET /api/axes/AX-PROCESS/pivots v_axis_process_pivots (PIV-340..353)
GET /api/processes v_axis_process_inventory
GET /api/processes/:process_code fn_process_node_substrate(:code)
GET /api/processes/:process_code/substrate resolver detail (steps/DOTs/triggers/queues/events/IU/gov/logs/health)
GET /api/processes/:process_code/runs job_queue ⋈ workflow (Type 2) / task_checkpoints (Type 3)
GET /api/processes/:process_code/health queue_heartbeat ⋈ v_queue_health + SLA flags
GET /api/processes/candidates v_axis_process_candidates
GET /api/processes/governance-gap v_axis_process_governance_gap

List columns (/processes)

process code/name · type (1/2/3) · object_class · lifecycle · birth_state · owner/gap · component_count · queue/job status · SLA/health · warning_flags · has_children(drill).

Drill targets (dynamic depth)

parent process → child process (sub-workflow) → step/task → DOT/script → trigger → queue/job → event → IU/SOP → document. has_children and next_pivot_code come from PG (resolver), never hardcoded.

h3 handler sketch (Nuxt server route)

// server/api/processes/[code]/substrate.get.ts
export default defineEventHandler(async (event) => {
  const code = getRouterParam(event, 'code')
  const { rows } = await pg.query(
    'SELECT fn_process_node_substrate($1) AS substrate', [code])
  if (!rows[0]?.substrate) throw createError({ statusCode: 404 })
  return rows[0].substrate   // PG-built jsonb; UI renders, computes nothing
})

Sample response (/processes/WF-001/substrate, live)

{ "process_code":"WF-001","title":"Quy trình duyệt công việc","status":"active","version":4,
  "level":1,"step_count":10,"step_types":{"action":5,"condition":2,"agent_call":1,
  "wait_for_event":1,"human_checkpoint":1},"relation_count":10,"change_requests":3,
  "linked_task":"TSK-004","iu_sop_ref":null,"owner":null,"health_dot":null,"birth_state":"BORN" }

iu_sop_ref/owner/health_dot = null surfaces the real governance gaps (not faked green).

Acceptance checklist (operator)

  1. PG counts only — no Nuxt arithmetic. 2. 404 on unknown process_code (FAILED-not-fake-green). 3. has_children from resolver. 4. candidate/gov-gap routes show non-final honestly. 5. redeploy after owner ratifies AX-PROCESS (CANDIDATE→ACTIVE).
Back to Knowledge Hub knowledge/dev/reports/architecture/process-workflow-axis-registries-pivot-birth-governance-ui-pilot-2026-06-04/08-ui-api-process-drilldown-contract.md