Skip to content

Reference catalog on declared graphs and across members, with quoted annotation keys #5097

Closed

Description

@lex00

The reference catalog is each lexicon's list of how its resources name each other. The catalog never runs on a declared graph or across workspace members, so no edge ever goes from a manifest to a Terraform resource. Its paths also cannot address an annotation key such as eks.amazonaws.com/role-arn. Part of #5094 and INTENTIUS/behold#1049, phase 3.

Today

  • readPath (packages/core/src/graph-refs.ts, line 164) splits on .. The header of lexicons/k8s/src/reference-catalog.ts names annotations and dotted label keys as out of reach for this reason.
  • The catalog runs in chant graph --live, in search --live, and over cloud indexes (deriveEdgesAcross, packages/core/src/lifecycle/derive-edges.ts, index: derived edges for indexed resources - referenceCatalog over indexed nodes #4522). compose-graph.ts adds only member links.
  • reconstructIndexedEdges (graph-refs.ts, line 383) is pure, refuses ambiguous matches, and reports dangling references with their rule id.
  • A declared Terraform node has kind Terraform::Resource, its provider type in attrs.type, the block text in attrs.source, and no arguments. A rule that targets google_service_account matches nothing.

Change

  • After composing, run reconstructIndexedEdges over the composed nodes on full attributes, whatever --detail asks for. Derived edges go in edges. Unresolved references go in top-level dangling with their rule. Ambiguous ones go in a new additive field.
  • Kubernetes names have to stay inside their member and namespace while cross-lexicon rules reach other members. One scopeOf per node cannot do both. The implementer picks two passes or a scope extension.
  • For this pass only, give each Terraform node its provider type as kind and its literal arguments as attrs, as lexicons/terraform/src/behaviour/request.ts does for the behaviour engine. Count the arguments that are not literal.
  • Add a quoted key segment to readPath, for example metadata.annotations["iam.gke.io/gcp-service-account"]. The exact syntax is a decision.

Done when

  • readPath returns ["x"] for that path on an object holding the annotation, and the existing catalog tests pass unchanged.
  • Fixture: member app has a Deployment with serviceAccountName: runner, and member rbac has ServiceAccount runner in the same namespace. The graph prints an edge with rule k8s:K8s::Apps::Deployment:spec.template.spec.serviceAccountName.
  • Rename the reference to missing and it appears in dangling with that rule.
  • Two members that both hold runner there give no edge and two recorded candidates.
  • --detail 0 output still has the derived edges.

Depends on

Nothing.

Not in this issue

The new rules, each with its own issue, and label selectors with dotted keys.

Activity

  1. added
    wave:3
    epic:surfaces
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:surfaceswave:3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions