Skip to content

ownership: lexicons declare their own key convention (drop core's aws/azure map) - #691

Merged
lex00 merged 1 commit into
mainfrom
refactor/686-ownership-keys-from-lexicons
Jul 5, 2026
Merged

lex00 merged 1 commit into
mainfrom
refactor/686-ownership-keys-from-lexicons

Conversation

@lex00

@lex00 lex00 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Closes #686.

Why

packages/core/src/ownership.ts enumerated every provider's marker-key convention (label / aws-tag / azure-tag) in a central CHANNEL_KEYS map. Adding a provider with a different tag/label convention meant editing core.

What

The core helpers (ownershipEntries/hasOwnershipMarker/readOwnership/classifyOwnership) now take a ChannelKeys object directly. Core owns only:

  • the generic stamp/detect logic, and
  • the shared label convention LABEL_OWNERSHIP_KEYS (used by k8s, gcp, and the Temporal kubectl --prune selector).

The AWS colon-key (chant:managed-by) and Azure hyphen-key (chant-managed-by) conventions move into their lexicons as AWS_TAG_OWNERSHIP_KEYS / AZURE_TAG_OWNERSHIP_KEYS, which pass them to the core helpers. OwnershipChannel and ownershipKeys are removed.

Verification

  • Emitted tags/labels are byte-for-byte unchanged — only where the key names are defined moved; the lexicon serializer/describe tests (which assert on emitted markers) all pass unchanged.
  • Core tsc clean; 2689 tests pass across core ownership + aws/azure/gcp/k8s/temporal. New focused tests lock the aws/azure key constants in their lexicons.

…/azure map (#686)

Core's ownership.ts enumerated every provider's marker-key convention
(`label`/`aws-tag`/`azure-tag`) in a central CHANNEL_KEYS map, so adding a
provider with a different tag/label convention meant editing core.

Now the core helpers (ownershipEntries/hasOwnershipMarker/readOwnership/
classifyOwnership) take a `ChannelKeys` object directly, and core owns only the
generic stamp/detect logic plus the shared label convention
(`LABEL_OWNERSHIP_KEYS`, used by k8s/gcp/temporal). The AWS colon-key
(`chant:managed-by`) and Azure hyphen-key (`chant-managed-by`) conventions move
into their own lexicons (`AWS_TAG_OWNERSHIP_KEYS`, `AZURE_TAG_OWNERSHIP_KEYS`),
which pass them to the core helpers. `OwnershipChannel`/`ownershipKeys` are
removed.

Emitted tags/labels are byte-for-byte unchanged — only where the key names are
defined moved. Verified: 2689 tests pass across core ownership + the
aws/azure/gcp/k8s/temporal lexicons (their serializers still emit the same
markers); core tsc clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lex00 lex00 added the enhancement New feature or request label Jul 5, 2026
@lex00
lex00 merged commit b20533d into main Jul 5, 2026
5 checks passed
@lex00
lex00 deleted the refactor/686-ownership-keys-from-lexicons branch July 5, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ownership: lexicons declare their ownership key convention (drop core's aws-tag/azure-tag map)

1 participant