Skip to content

HostBuild leg names are string literals duplicated across core and every plugin that calls them #1229

Open

Description

@aitrawog

What is wrong (duplication, R2)

A HostBuild leg's kind string is the wire identity between the core that registers it and every plugin that calls it, and today each module spells it as its own string literal. Measured for validate-word-sets (2026-11-21): charly/validate_project_host.go (const validateWordSetsBuilderKind), plugin-box/candy/plugin-box/validate.go (a second const validateWordSetsBuilderKind), and — with opencharly/sdk#598 — plugin-build/candy/plugin-build/owned_content.go (validateWordSetsLeg). plugin-build spells its other legs as bare literals too (hostBuildJSON(ctx, ex, "buildengine-context-ignore-baseline", …)). A rename in core breaks every caller at runtime, with no compile error.

Why a shared constant is not the drop-in fix

The sdk#598 change tried one (spec.HostBuilderValidateWordSets) and two core gates rejected it, both correctly:

  • TestNoAliasForms_ZeroPackageLevelReexports refuses const validateWordSetsBuilderKind = spec.X in core (a re-export alias form);
  • TestReverseChannelIsThreeLegs audits every registerHostBuilder kind by parsing CORE source alone, and cannot resolve a spec.X selector — the registered kind is meant to be readable in core.

What would close it

One source of each leg's identity that both the core audit and the plugins can read — e.g. the leg table generated into spec from a single CUE/Go list the audit also consumes — and every literal deleted (claim-keyed grep pasted).

Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942
Assisted-by: Claude Code Claude Opus 5.5 (analysed on a live system)

Activity

  1. added
    category:runtime
    type:chore
    on Nov 23, 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

    category:runtimetype:chore

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions