Skip to content

Remove label-map.json schema (now owned by release-kit) #469

Description

@williamthorsen

Problem

The label-map.json schema currently lives at packages/agents/schemas/label-map.json in this repo, and generated label-map.json files reference it via https://github.com/williamthorsen/codeassembly/raw/agents-v0.1.0/packages/agents/schemas/label-map.json. The schema is minimal and generically useful — nothing about it is agent-specific. Its natural owner is @williamthorsen/release-kit, which already owns .github/labels.yaml (the canonical label declaration) and ships its schemas at stable, semver-tagged URLs.

This ticket migrates codeassembly to consume the release-kit-hosted schema and removes the local copy.

Context

  • Companion ticket williamthorsen/node-monorepo-tools#322 is shipped: release-kit v5.1.0 publishes the schema at https://github.com/williamthorsen/node-monorepo-tools/raw/release-kit-v{version}/packages/release-kit/schemas/label-map.json.
  • Release-kit v5.1.0 also renamed the utility label to internal. Codeassembly's generator still emits internal: utility. The rename rides along with this ticket because regenerating .meta/label-map.json after the release-kit bump must produce values that exist in .github/labels.yaml, and that file will declare internal (not utility) once it's regenerated against the v5.1.0 preset.
  • Old $schema URLs in any external repo that pinned raw/agents-v0.1.0/... continue to resolve — that URL points at an immutable tag. Deleting packages/agents/schemas/label-map.json from main only affects future regenerations from this repo's generator, not historical references.
  • Drift detection between .meta/label-map.json and .github/labels.yaml (the original concern of #418) is being handled by #505 — explicitly out of scope here. This ticket does not close #418; Validate .meta/label-map.json label values against .github/labels.yaml at generate-time #505 does.

Solution

In packages/agents/src/commands/generate-label-map.ts:

  • Replace buildSchemaUrl() so it emits https://github.com/williamthorsen/node-monorepo-tools/raw/release-kit-v{version}/packages/release-kit/schemas/label-map.json, where {version} is the installed release-kit version (read at runtime from node_modules/@williamthorsen/release-kit/package.json, mirroring the existing pattern of reading the agents version from its own package.json).
  • Update TYPE_MAP['internal'] from 'utility' to 'internal'.

Update tests in packages/agents/src/commands/__tests__/generate-label-map.test.ts to reflect the new URL pattern and the renamed label.

Regenerate .meta/label-map.json in this repo (codeassembly-agents generate label-map --force).

Delete packages/agents/schemas/label-map.json.

Verify no remaining references to the codeassembly schema URL pattern in the codebase.

Optionally regenerate .meta/label-map.json in other repos under our ownership for consistency. Their existing files continue to validate against the immutable tag URL, so this is a clean-up nicety, not a fix.

Acceptance criteria

  • generate-label-map.ts:buildSchemaUrl() emits a release-kit-v{installed-version} URL pointing at the release-kit schema path.
  • TYPE_MAP['internal'] is 'internal' (not 'utility').
  • .meta/label-map.json in this repo is regenerated: $schema references the new release-kit URL; types.internal is 'internal'.
  • packages/agents/schemas/label-map.json is removed.
  • No remaining references in this repo to the codeassembly schema URL pattern (grep -rn "codeassembly.*label-map.json" returns nothing).
  • Tests in generate-label-map.test.ts updated to reflect the new URL pattern and the renamed label.
  • Documentation referencing the old URL or the local schema file is updated.
  • Other repos under our ownership are audited for .meta/label-map.json files; regenerate where present for consistency, or note absent.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions