Skip to content

test(schema): keep the catalog's distribution identifier types in step with the schema enum - #9010

Merged
bokelley merged 1 commit into
mainfrom
test/distribution-identifier-parity
Nov 14, 2026
Merged

bokelley merged 1 commit into
mainfrom
test/distribution-identifier-parity

Conversation

@bokelley

@bokelley bokelley commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #8995 (#8992). Tests only, for the 3.3 rc.0.

Summary

#8995 added eight social types to enums/distribution-identifier-type.json and to the AAO catalog's own copy of the list, DISTRIBUTION_IDENTIFIER_TYPE_VALUES in server/src/services/collection-identifier-normalization.ts. Nothing checked that the two lists match, and they had drifted before. Its server test lists the eight values by hand, so a later schema addition could still be missed.

This PR adds two tests:

  • Server parity (server/tests/unit/services/collection-identifier-normalization.test.ts, new describe block). It reads the schema enum from static/schemas/source and asserts that DISTRIBUTION_IDENTIFIER_TYPE_VALUES has the same members, naming any value missing from either side. It also checks that isValidDistributionIdentifierType accepts every enum value and rejects an unknown one. A future enum addition now fails the server unit tests until the catalog list is updated too.
  • Schema probes (new tests/social-distribution-identifiers.test.cjs, added to test:schemas). These cover:
    • Accept and reject: each of the eight types validates as a distribution[].identifiers entry on core/collection-distribution.json, and an unknown type is rejected.
    • Descriptions: every value has an enumDescriptions entry. The ID descriptions say the ID is the preferred canonical identifier, and the handle descriptions say the ID is preferred for matching.
    • Order: the existing values keep their order.

No schema, server source or docs change, so there's no changeset, per the playbook's rule for non-protocol changes.

Testing

Rebased onto main d6c0f99f5a to clear a package.json conflict on the test:schemas line. The only change is this PR's one entry, and both files pass again on the rebased tree. The runs below were on main d62521aee5 (after #8995) plus this commit:

  • npx vitest run --config server/vitest.config.ts tests/unit/services/collection-identifier-normalization.test.ts: 48/48. The 14 from feat(schema): add Instagram, Facebook, Snapchat and X distribution identifier types #8995 plus 34 new: the set-equality check, one acceptance case per enum value, and the unknown-value rejection.
  • node --test tests/social-distribution-identifiers.test.cjs: 13/13.
  • node scripts/check-changeset-protocol-scope.cjs origin/main: pass, with no changeset.
  • Pre-commit hook: committed with the full hook, server unit stage included. It passed.
  • Pre-push: the local storyboard matrix was skipped with ADCP_SKIP_STORYBOARD_MATRIX=1, as the playbook allows. On the first attempt it was still in the /sales stage after an hour, at host load ~100. This PR touches no compliance or storyboard file. CI's storyboard job is the gate.

🤖 Generated with Claude Code

@aao-secretariat

Copy link
Copy Markdown
Contributor

Ladon cannot review this PR until merge conflicts are resolved.

…p with the schema enum

and to the AAO catalog's own copy, DISTRIBUTION_IDENTIFIER_TYPE_VALUES.
Nothing checked that the two lists match, and they had drifted before.

The server unit test now reads the schema enum and asserts the catalog
list has the same members, naming any value missing from either side, and
that isValidDistributionIdentifierType accepts every enum value and rejects
an unknown one.

New tests/social-distribution-identifiers.test.cjs, in test:schemas,
validates each of the eight types as a distribution identifier on
core/collection-distribution.json, rejects an unknown type, checks every
value has an enumDescriptions entry and the ID-over-handle wording, and
pins the order of the values that existed before 3.3.

Tests only; no changeset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bokelley
bokelley force-pushed the test/distribution-identifier-parity branch from c14bc3e to 356df9f Compare November 14, 2026 14:40

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — tests-only follow-up to #8995.

This PR changes 3 files (package.json, a server parity test, and a new tests/social-distribution-identifiers.test.cjs registered in test:schemas). It pins DISTRIBUTION_IDENTIFIER_TYPE_VALUES and the schema enum together, with order/accept/reject assertions verified to match distribution-identifier-type.json and collection-distribution.json exactly. No schema/source/docs change, so no changeset is required.

No Critical/High/Medium findings reported. Not gated_paths, not high_risk, no author-team gate, no prior decision. None of decision rows 1–8 fire → row 9 approve.

@bokelley
bokelley merged commit bbf10ef into main Nov 14, 2026
61 checks passed
@bokelley
bokelley deleted the test/distribution-identifier-parity branch November 14, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant