feat(api-catalog): add drift guards for the embedded catalog (DEVX-549)#98
Merged
jpage-godaddy merged 3 commits intoJul 15, 2026
Conversation
Two complementary guards so the embedded API catalog can't silently drift from the upstream commerce.*-specification source of truth: 1. Always-on structural guard (cargo test, no network/credentials): a new EXPECTED_DOMAINS contract + committed_catalog_matches_expected_domains_and_manifest test asserts the committed catalog files and manifest.json match the intended domain set, and that each domain's endpoint count agrees between its file and the manifest. Adding/removing a domain now requires a deliberate list update. 2. Scheduled source-drift guard (.github/workflows/catalog-drift.yml): weekly (and on-demand) regenerates the catalog from the gdcorp-platform spec repos and fails if the committed domain schemas have drifted. Gated on a CATALOG_SPEC_TOKEN secret (the default GITHUB_TOKEN can't reach the spec org); no-ops without it. manifest.json's generated-at timestamp is excluded from the diff. EXPECTED_DOMAINS is #[cfg(test)] since only the guard test consumes it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- guard test: fail loudly (panic with domain name) on a missing endpoints array or endpointCount instead of comparing two silent zeros - catalog-drift workflow: add timeout-minutes: 20 to bound a hung spec fetch - clarify the regen step uses the job-default rust/ working-directory Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
||
| on: | ||
| schedule: | ||
| - cron: "17 6 * * 1" # Mondays ~06:17 UTC |
Collaborator
There was a problem hiding this comment.
Very specific, haha
Collaborator
|
DEVX-549 doesn't seem related to this; that's for the Moon Unit project. Can you fix the title to link to the related Jira? |
Make the reconciled source manifest drive generation and fail CI on partial or stale upstream catalogs. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Verified the Jira reference again: DEVX-549 is currently Task 11 — Commerce catalog parity + drift guard, and its description/acceptance criteria match this PR. I kept the title on DEVX-549 and added the direct Jira link plus the completed implementation details to the PR description. |
jpage-godaddy
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Rust embedded API catalog was generated from internal specification repositories without one checked-in source list or a reliable drift check. TypeScript
maincontains 20 domains whilerust-portcontains 21, and the previous workflow could silently skip when its token was missing or overlook newly generated files.Jira: DEVX-549 — Commerce catalog parity + drift guard
Fix
rust/api-catalog-sources.jsonas the authoritative catalog source manifest.hosting-nodejsis the intentional Rust-only domain generated from the CLI's vendored public spec.CATALOG_SPEC_TOKENfails instead of silently skipping,rust-portand by manual dispatch,rust-portbecomes the default branch.Operations
Configure the repository secret
CATALOG_SPEC_TOKENwith read access to the declaredgdcorp-platformspecification repositories. Untilrust-portbecomes the default branch, pushes torust-portenforce upstream drift andworkflow_dispatchprovides on-demand checks.Verification
cargo checkcargo clippy -- -D warningscargo test— 230 passedcargo fmt --check