Skip to content

feat(lexicons): generate an OKF knowledge bundle per lexicon at build time #1060

Closed

Description

@lex00

Part of #1057. The most mechanical of the three; can land after #1058 and #1059.

Why this is cheap

Lexicons are generated from their target specs, so the codegen already holds everything a knowledge bundle needs: resource type names, property names and types, descriptions carried over from the source spec, the attribute registry, and the lint rules that reference those types.

Emitting a bundle is mostly plumbing over structures that already exist, alongside the artifacts each lexicon build already produces (src/generated/, dist/meta.json).

Why it is worth doing

An agent gets lexicon knowledge from chant's MCP server today, which means it needs an integration. A bundle shipped in the package needs no server, which is the property Google names explicitly: consumable without an integration.

It also gives non-agent consumers something to read. A bundle is browsable in a repo without running anything.

Shape

One concept per resource type, with type identifying the concept category rather than the resource type itself (unlike #1058, where an entity's type is its resource type — worth resolving the vocabulary between the two so a consumer can tell a lexicon bundle from a project bundle).

Links from a resource concept to the lint rules that govern it, and from a rule concept back to the types it applies to. Rules already carry an id, severity, and a docs page, so they are natural concepts.

Acceptance criteria

  • A lexicon build emits a conformant bundle for its resource types and lint rules.
  • Concepts cross-link in both directions between resource types and the rules governing them.
  • Spec-sourced property descriptions are carried into the concept body where the generator has them.
  • Bundles are shipped in the published package.
  • The same conformance test from feat(core): emit an OKF knowledge bundle from the discovered graph (explain --format okf) #1058 passes over lexicon bundles.
  • Applied to at least two lexicons with different generation paths (for example one CloudFormation-derived and one OpenAPI-derived) to prove the approach is not shaped around a single generator.

Open question

Whether this belongs in the shared codegen or per lexicon. Shared is less duplication and one more thing every lexicon inherits; per lexicon lets generation paths differ where the source specs genuinely differ.

Activity

  1. added
    enhancement
    on Jul 26, 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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions