KB-175F

One-Roof Clone Axis/Topic — 07 UI/API Read Contract (Obj F, live JSON)

5 min read Revision 1
one-roofnonprod-cloneaxis-substrateui-apiread-contracttopic-treecoverage-summaryjson

07 — Objective F: UI / API Read Contract for Axis/Topic

Verdict: PASS — produced (read queries + live JSON samples from the clone). All read-only. No production UI/Nuxt/Directus mutation.

Each contract below is a single read query over the committed clone substrate; the JSON shown is actual output, not illustrative.

1. Coverage summary (GET /axis/coverage-summary)

SELECT jsonb_agg(to_jsonb(s) ORDER BY s.axis_code) FROM v_axis_coverage_summary s;
[ {"axis_code":"responsibility","axis_kind":"system","status":"active","required_cells":210,
   "gap_cells":0,"ok_assignments":0,"low_conf":0,"stale":0,"quarantine":0},
  {"axis_code":"topic","axis_kind":"uncertain","status":"active","required_cells":6,
   "gap_cells":2,"ok_assignments":3,"low_conf":1,"stale":1,"quarantine":1} ]

2. Axis registry (GET /axis/registry)

SELECT jsonb_agg(jsonb_build_object('axis_code',axis_code,'name',axis_name,'family',axis_family,
       'kind',axis_kind,'status',status,'lifecycle',lifecycle_status) ORDER BY axis_code) FROM axis_registry;

Returns the 3 axes: containment (deterministic, candidate), responsibility (system, active), topic (uncertain, active).

3. Topic tree / graph (GET /axis/topic/tree)

SELECT jsonb_agg(jsonb_build_object('value',value_code,'parent',parent_value_code,
       'status',status,'provenance',provenance)) FROM axis_value WHERE axis_code='topic';
[ {"value":"governance","parent":null,"provenance":{"designated_by":"human"}},
  {"value":"workflow","parent":null,"provenance":{"designated_by":"human"}},
  {"value":"ai-ops","parent":"governance","provenance":{"designated_by":"agent","model":"dot"}},
  {"value":"registry-kg","parent":"governance","provenance":{"designated_by":"agent","model":"dot"}} ]

The parent field gives the UI the tree edges; provenance.designated_by gives the human-vs-AI badge.

4. Candidate vs official lanes (GET /axis/lanes)

SELECT jsonb_build_object(
  'official_approved',(SELECT count(*) FROM axis_assignment WHERE zone='approved'),
  'candidate',        (SELECT count(*) FROM axis_assignment WHERE zone='candidate'),
  'quarantine',       (SELECT count(*) FROM axis_assignment WHERE zone='quarantine'));

{"official_approved":0,"candidate":5,"quarantine":1}. The official (approved) lane is empty by design — nothing has been promoted; the UI's official topic view stays empty until a governed promotion flips zone to approved.

5. Object → topic (GET /object/{ref}/topics)

SELECT jsonb_agg(jsonb_build_object('object',a.object_ref,'topic',a.value_code,'zone',a.zone,
       'confidence',a.confidence,'assigned_kind',a.assigned_kind,'quality',q.quality_flag) ORDER BY a.object_ref)
FROM axis_assignment a JOIN v_axis_assignment_quality q USING (id) WHERE a.axis_code='topic';

Returns the 6 object→topic rows with zone/confidence/kind/quality (e.g. modulesworkflow zone candidate conf 0.55 quality low_confidence; iu_staging_recordai-ops zone quarantine quality quarantine).

6. Findings digest (GET /axis/findings)

SELECT jsonb_agg(jsonb_build_object('type',finding_type,'severity',severity,'count',c))
FROM (SELECT finding_type,severity,count(*) c FROM axis_candidate_finding GROUP BY 1,2) z;

→ low_confidence(1), missing_assignment(29,info), missing_owner(2), quarantine(1), stale_topic(1).

7. Issue/event payload (GET /axis/events/shaped)

SELECT * FROM v_axis_issue_payload — the dispatch-ready-but-inert event shapes (doc 06), each carrying type_active=false.

UI lane discipline

  • Official lane reads zone='approved' only → currently empty (correct: nothing promoted).
  • Candidate lane reads zone='candidate' → AI/human proposals under review.
  • Quarantine reads zone='quarantine' → never shown as official; governed as input-quality.
  • Coverage badges read v_axis_coverage_summary; the topic tree reads axis_value.parent_value_code.

No endpoint writes; all are SELECTs the existing read API (or a Nuxt server route) can expose unchanged.

Back to Knowledge Hub knowledge/dev/reports/architecture/one-roof-nonprod-clone-axis-topic-substrate-pipeline-2026-06-02/07-ui-api-read-contract.md