Skip to content

Catalog: refs table is materially incomplete (misses most action refs, all associations, all layout/widget refs) #663

Description

@ako

Summary

The catalog refs table (cross-reference index that powers show callers|callees|references|impact|context of … after refresh catalog full) is a curated best-effort index, not a complete reference graph. It is built by a hand-maintained switch in mdl/catalog/builder_references.go — the same fragile pattern that silently dropped action types in catalog.activities (fixed in 6574e9c). Verified on mx-test-projects/MxGraphStudioDemo.

Gap 1 — microflow action refs: only 5 of ~15 reference-bearing action types

buildReferences extracts refs from MicroflowCallAction, CreateObjectAction, RetrieveAction (only DatabaseRetrieveSource), ShowPageAction, JavaActionCallAction. Every other reference-bearing action produces no ref. Present in MxGraphStudioDemo with zero refs emitted:

Action (in activities) count should reference
ChangeObjectAction 17 entity / member
DeleteObjectAction 3 entity
NanoflowCallAction 3 nanoflow
RestCallAction / RestOperationCallAction 1 + 1 consumed REST service
CastAction 1 entity

Also unhandled in general: AggregateListAction, CallExternalAction, CommitAction, and RetrieveAction via AssociationRetrieveSource.

Gap 2 — associations: 52 in project, 0 associate refs

Explicit TODO at builder_references.go:168 (// Association references require resolving ChildID … Skipping for now). The associate RefKind constant exists but is never written.

Gap 3 — page layout / widget / datasource / action refs: all 0

refs has 0 rows for layout, datasource, action even though the pages table proves layouts exist (LayoutRef populated, e.g. ActiveSessions → Atlas_Core.Atlas_Default) and there are 36 action widgets. Root cause: extractWidgetRefs / extractDataSourceRefs / layout-ref emission are all gated behind if pg.LayoutCall != nil (builder_references.go:182–195), and LayoutCall is unpopulated on the cached pages, so the whole widget subtree is skipped. Only page parameter refs (from pg.Parameters) survive.

Effect

show callers/callees/references/impact silently under-report — e.g. "who calls this nanoflow", "what uses this REST service", "which pages use this layout", "what references this association" all miss results.

Fix plan (incremental, with tests + bug-test MDL where applicable)

  1. Microflow action refs — add the missing reference-bearing action types (change/delete/nanoflow-call/rest/cast/aggregate/commit/cast, association-retrieve source).
  2. Association refs — resolve association target entity (ChildID → entity QN) and emit associate refs.
  3. Page widget refs — fix the LayoutCall-gating so layout/datasource/widget/action refs emit regardless of whether the page is parsed via a layout call.

References

  • mdl/catalog/builder_references.go
  • Sibling fix for the same anti-pattern: 6574e9c (catalog.activities)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions