Skip to content

chore(openapi): regenerate registry.yaml from Zod source (catchup)#4515

Merged
bokelley merged 1 commit into
mainfrom
chore/regen-openapi-yaml
May 14, 2026
Merged

chore(openapi): regenerate registry.yaml from Zod source (catchup)#4515
bokelley merged 1 commit into
mainfrom
chore/regen-openapi-yaml

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

Pure regen of static/openapi/registry.yaml from the Zod source in server/src/schemas/registry.ts. The published yaml had drifted ~340 lines behind. No schema-shape changes, no new endpoints, no behavior change.

Why this PR exists

package.json has both halves of a freshness check:

  • build:openapitsx scripts/generate-openapi.ts (the regen)
  • test:openapi... && git diff --exit-code static/openapi/registry.yaml || (echo 'OpenAPI spec is out of date...' && exit 1) (the drift gate)

But test:openapi lives only inside the umbrella npm run test script — build-check.yml cherry-picks ~10 specific test scripts and test:openapi is not one of them. So Zod-schema PRs land without triggering a regen, and drift accumulates until someone happens to run npm run build:openapi locally as part of an unrelated PR (most recently #4513, which would otherwise have absorbed all this catchup and confused future blame).

Drift swept in (already-shipped behavior, just being written down)

  • Publisher.discovery_method + manager_domain (one-hop ads.txt MANAGERDOMAIN delegation)
  • Publisher.hosting.{self_redirected, resolved_url, last_validated, last_http_status, last_bytes} (verifier-grade chrome)
  • verdict_source on the compliance response
  • MemberAgentTypeInput schema split + required type on POST/PATCH /api/me/agents and on the stored read shape
  • Removal of tracks_silent (storyboard run summary)
  • tools_count + tools[] on the agent-probe response
  • New endpoints: POST /api/registry/agents/{encodedUrl}/refresh, POST /api/registry/agents/{encodedUrl}/monitoring/requeue, POST /api/registry/manager-revalidation-request

Follow-up

Add npm run test:openapi to .github/workflows/build-check.yml so the gate fails its own PR going forward. Filing as a separate issue.

Test plan

  • npm run build:openapi is clean (idempotent — re-running produces no further diff)
  • Diff is yaml-only; no source schemas changed
  • Confirm CI build-check passes

🤖 Generated with Claude Code

The published yaml had drifted ~340 lines behind server/src/schemas/registry.ts
because npm run test:openapi (the freshness gate in package.json) is not wired
into build-check.yml. Zod-schema PRs land without triggering a regen, so drift
accumulates until someone happens to run npm run build:openapi locally.

This is a pure catchup — no schema-shape changes, no new endpoints, no
behavior change. Drift swept in: publisher.discovery_method/manager_domain,
publisher.hosting.{self_redirected,resolved_url,last_validated,
last_http_status,last_bytes}, verdict_source on the compliance response,
MemberAgentTypeInput schema split, required type on member-agent read/write
surfaces, removal of tracks_silent, tools_count/tools[] on the agent probe
response, and the /refresh, /monitoring/requeue, /manager-revalidation-request
endpoints.

Follow-up: add npm run test:openapi to build-check.yml so the gate fails its
own PR instead of letting drift accumulate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley force-pushed the chore/regen-openapi-yaml branch from 4ec2850 to 59c4f60 Compare May 14, 2026 08:00
bokelley pushed a commit that referenced this pull request May 14, 2026
The OpenAPI freshness script (tsx scripts/generate-openapi.ts && git diff
--exit-code static/openapi/registry.yaml) already existed in package.json
and ran inside the umbrella npm run test. But build-check.yml cherry-picks
specific test scripts and never invoked it, so Zod-schema PRs were landing
without regenerating static/openapi/registry.yaml. Drift accumulated until
someone happened to run npm run build:openapi locally (e.g. #4515 absorbed
~340 lines).

After this change any PR that edits server/src/schemas/registry.ts (or any
schema reachable from generate-openapi.ts) without regenerating the yaml
will fail its own CI with the existing error message:
"OpenAPI spec is out of date. Run: npm run build:openapi".

Workflow-only — no source schemas change. Closes #4516.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit 3e6f6a7 into main May 14, 2026
13 checks passed
@bokelley bokelley deleted the chore/regen-openapi-yaml branch May 14, 2026 08:05
bokelley pushed a commit that referenced this pull request May 14, 2026
The OpenAPI freshness script (tsx scripts/generate-openapi.ts && git diff
--exit-code static/openapi/registry.yaml) already existed in package.json
and ran inside the umbrella npm run test. But build-check.yml cherry-picks
specific test scripts and never invoked it, so Zod-schema PRs were landing
without regenerating static/openapi/registry.yaml. Drift accumulated until
someone happened to run npm run build:openapi locally (e.g. #4515 absorbed
~340 lines).

After this change any PR that edits server/src/schemas/registry.ts (or any
schema reachable from generate-openapi.ts) without regenerating the yaml
will fail its own CI with the existing error message:
"OpenAPI spec is out of date. Run: npm run build:openapi".

Workflow-only — no source schemas change. Closes #4516.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bokelley pushed a commit that referenced this pull request May 14, 2026
Re-regen captures Emma's three new member.* fields plus a small post-#4515
drift sweep that landed today (verification_mode/verified query params on
agent listing; 400 response shape).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bokelley pushed a commit that referenced this pull request May 14, 2026
)

* feat(registry): expose membership tier on public operator lookups

/api/registry/operator?domain=X now surfaces the queried member's AAO
membership tier when the profile owner has opted their member card into
public visibility (is_public=true). The member object grows two optional
fields: membership_tier (raw enum, e.g. company_leader) and
membership_tier_label (human-readable, e.g. Leader).

Private profiles still return only { slug, display_name } — tier reflects
billing state, so we follow the existing profile-card visibility toggle
rather than introducing a second one. The fields are absent (not null)
for private profiles and for orgs without a resolvable tier, so existing
consumers see no shape change.

* fix(operator-lookup): add is_founding_member and correct Partner label

Public operator lookup now exposes is_founding_member alongside the
membership tier when the profile is public. Founding Member is orthogonal
to tier — founding orgs like Scope3 display both (Partner + Founding
Member) on their member card, so a single tier field doesn't capture the
intent.

Also fixes the company_icl label in services/membership-tiers.ts from
"Member" to "Partner" so it matches the AAO pricing page and the
dashboard's local tier map (which already used "Partner"). The label was
internal-only previously; surfacing it on the operator endpoint forced
the naming inconsistency to surface.

Schema, OpenAPI spec, and unit tests updated. Private profiles still
return only { slug, display_name } — no shape change for existing
consumers.

* chore(openapi): regenerate registry.yaml after rebase

Re-regen captures Emma's three new member.* fields plus a small post-#4515
drift sweep that landed today (verification_mode/verified query params on
agent listing; 400 response shape).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Brian O'Kelley <brian@agenticadvertising.org>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bokelley pushed a commit that referenced this pull request May 14, 2026
The OpenAPI freshness script (tsx scripts/generate-openapi.ts && git diff
--exit-code static/openapi/registry.yaml) already existed in package.json
and ran inside the umbrella npm run test. But build-check.yml cherry-picks
specific test scripts and never invoked it, so Zod-schema PRs were landing
without regenerating static/openapi/registry.yaml. Drift accumulated until
someone happened to run npm run build:openapi locally (e.g. #4515 absorbed
~340 lines).

After this change any PR that edits server/src/schemas/registry.ts (or any
schema reachable from generate-openapi.ts) without regenerating the yaml
will fail its own CI with the existing error message:
"OpenAPI spec is out of date. Run: npm run build:openapi".

Workflow-only — no source schemas change. Closes #4516.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bokelley added a commit that referenced this pull request May 14, 2026
* ci: wire npm run test:openapi into build-check.yml

The OpenAPI freshness script (tsx scripts/generate-openapi.ts && git diff
--exit-code static/openapi/registry.yaml) already existed in package.json
and ran inside the umbrella npm run test. But build-check.yml cherry-picks
specific test scripts and never invoked it, so Zod-schema PRs were landing
without regenerating static/openapi/registry.yaml. Drift accumulated until
someone happened to run npm run build:openapi locally (e.g. #4515 absorbed
~340 lines).

After this change any PR that edits server/src/schemas/registry.ts (or any
schema reachable from generate-openapi.ts) without regenerating the yaml
will fail its own CI with the existing error message:
"OpenAPI spec is out of date. Run: npm run build:openapi".

Workflow-only — no source schemas change. Closes #4516.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci: provide dummy WorkOS/Stripe/Resend env vars to OpenAPI freshness step

generate-openapi.ts transitively imports auth middleware which constructs
WorkOS at module load — the script never makes a network call but the
constructor demands API key or client ID. Dummy values satisfy validation;
CI doesn't ship real secrets and shouldn't need to for spec generation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: re-trigger CI

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci: bump build-check timeout from 15 to 20 minutes

The added OpenAPI freshness step re-runs scripts/generate-openapi.ts,
which is import-heavy. Combined with the existing 10-script pipeline,
the job started timing out at exactly 15 min. 20 gives headroom without
masking real regressions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(generate-openapi): explicit process.exit so the script doesn't hang on module-load timers

Importing server/src/routes/registry-api.js pulls in:
  - middleware/auth.ts          (3 module-level setInterval calls for
                                 session-cache cleanup, etc.)
  - middleware/pg-rate-limit-store.ts  (setInterval flushing
                                 in-memory rate-limit buckets to PG)

Those timers keep the Node event loop alive after the yaml has been
written, so the script sits idle until the surrounding CI job hits its
timeout. Locally the timers sometimes get unreferenced by tsx fast
enough that the script appears to exit, but the behavior was always
fragile; in CI the same code reliably runs 17+ minutes before the job
times out (vs ~3s of real work).

Explicit process.exit(0) — we're done as soon as the file is written,
and we don't need a long-running auth subsystem in a build-time spec
generator.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Brian O'Kelley <brian@agenticadvertising.org>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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