docs: harden the OpenAPI sync policy against publishing private surfaces - #445
docs: harden the OpenAPI sync policy against publishing private surfaces#445hongyi-chen wants to merge 2 commits into
Conversation
The docs-side sync script kept a stale tag allowlist and deliberately retained x-internal operations, so --mode apply would have published Factory, memory_stores, and the orchestration messaging endpoints. Honor x-internal (matching warp-server's public-openapi-filter.yaml), add the renamed memory tag and the factory tag, and exclude the /factory path prefix since some of its operations are tagged agent. No change to developers/agent-api-openapi.yaml. Co-Authored-By: Oz <oz-agent@warp.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR updates the OpenAPI sync policy and script to strip x-internal operations and exclude newly private tags/path prefixes from the generated public API spec.
Concerns
- The tag exclusion logic still only drops a path when all operation tags are excluded. A mixed path can retain an operation tagged with an excluded private surface if it is not also marked
x-internaland does not match/factory, which conflicts with the stated belt-and-braces policy.
Security
- The filtering gap can publish a private tagged operation in the public API reference when it shares a path item with a public operation.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| if path.startswith(EXCLUDED_PATH_PREFIXES): | ||
| return False | ||
| tags = _path_tags(path_item) | ||
| if tags and tags.issubset(EXCLUDED_TAGS): |
There was a problem hiding this comment.
memory/factory operation that is not x-internal, the excluded-tag operation is kept because strip_internal_operations() only removes x-internal. Strip excluded-tag operations too, or reject mixed paths before publishing.

Summary
Running
sync-openapi-specin--mode applytoday would publish private surfaces into the public API reference atdocs.warp.dev/api. This PR fixes the policy so the script can't do that. No spec content changes —developers/agent-api-openapi.yamlis untouched.Found while triaging API findings during a
missing_docsdrift-watch run.The problem
The docs repo and warp-server both generate the same published file, but they disagreed on what counts as public.
warp-server's
script/generate-public-openapifilters onx-internal: true(public_api/public-openapi-filter.yaml) and publishes through the release-gatedsync_public_openapi_to_docsworkflow. The docs-side script instead kept a hand-maintained tag allowlist and, per its own docstring, keptx-internal: trueoperations verbatim.That allowlist had gone stale. A
--mode diffagainst current warp-server reported 31 paths to add and 20 unclassified!warnings, including:/factory/*paths (Oz Factory is unreleased;FactoryMcpis dogfood),/memory_stores(Agent Memory is research preview) — the tag was renamedmemory_stores→memoryupstream, and only the old name was excluded, so the rename silently reopened the surface,/agent/messages/*and/agent/events/*orchestration-messaging operations, all explicitly markedx-internal: trueupstream.Changes
.agents/skills/sync-openapi-spec/scripts/sync_openapi.pyx-internal: true:strip_internal_operationsdrops internal operations, and_has_public_operationdrops a path whose operations are all internal. This mirrors warp-server's own filter, so a surface the server team marks private stays private here without a matching allowlist entry.memoryandfactorytoEXCLUDED_TAGS(keepingmemory_storesfor the pre-rename name).EXCLUDED_PATH_PREFIXES = ("/factory",). A tags-only rule isn't sufficient: some Factory operations are taggedagentupstream (for exampleGET /factory/scorers/{scorer_id}/results), so they survived the tag filter..agents/skills/sync-openapi-spec/references/sync-policy.mdx-internalbehavior.x-internalupstream as the preferred fix, since that hides it from both publishers at once.Verification
Before,
--mode diffreported 31 paths to add and 20!unclassified warnings. After:No
!warnings remain, and both remaining paths are genuinely public upstream (nox-internalmarker).--mode self-testpasses.npm run buildpasses.Why
--mode applywas not runwarp-server's release-gated workflow is the authoritative publisher for
developers/agent-api-openapi.yaml; it opens its own PR onautomation/sync-agent-api-spec. Hand-applying here would duplicate that pipeline and land a large schema regeneration outside the release gate. The two genuinely-public endpoints above will arrive through that automation. This PR only makes the fallback path safe to use when it is needed.Conversation: https://staging.warp.dev/conversation/53c4f3f8-39bb-46c1-a5c0-66b467db0439
Run: https://oz.staging.warp.dev/runs/019fb91e-74a0-73f4-ac72-f2d88c32fab5
This PR was generated with Oz.
Co-Authored-By: Oz oz-agent@warp.dev