Skip to content

docs(api): fill generated query descriptions#4624

Merged
koala73 merged 4 commits into
mainfrom
codex/issue-4606-api-param-descriptions
Jul 2, 2026
Merged

docs(api): fill generated query descriptions#4624
koala73 merged 4 commits into
mainfrom
codex/issue-4606-api-param-descriptions

Conversation

@koala73

@koala73 koala73 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

Intent

Fix the 74 empty generated OpenAPI query parameter descriptions identified in #4606 through the upstream proto-comment convention.

Non-goals: response-schema description debt still listed in the existing high-risk allowlist, runtime endpoint behavior, auth/rate-limit behavior, and broader proto lint cleanup.

Validation Matrix

Check Status Evidence
Live issue/PR truth Pass #4606 open; no existing PR found for this issue before branch creation
Baseline generated query scan Reproduced TOTAL_EMPTY=74, matching the issue scope
npm ci --ignore-scripts --cache /tmp/worldmonitor-npm-cache --prefer-offline Pass Installed test toolchain without postinstall side effects
Proto source query-comment scan Pass NO_COMMENT_QUERY_FIELDS=0
PATH="$PWD/node_modules/.bin:$PATH" GOTOOLCHAIN=auto make generate Pass Regenerated checked-in TS/OpenAPI artifacts; security injection updated 35 artifacts
node --test tests/generated-api-description-guard.test.mjs Pass 3/3 tests pass, including all-query-parameter description and placeholder guards
Independent OpenAPI JSON query scan Pass TOTAL_QUERY=341, TOTAL_EMPTY=0, TOTAL_PLACEHOLDER=0
npm run lint:api-contract Pass 117 API files checked; 83 manifest entries validated
node --test tests/market-methodology-doc-contracts.test.mjs Pass 4/4 tests pass
npm run typecheck:api Pass API tsc + Convex string-call audit pass
npm run typecheck Pass tsc --noEmit pass
git diff --check Pass No whitespace/conflict-marker issues
PATH="$PWD/node_modules/.bin:$PATH" make lint Blocked Existing unrelated repo-wide proto lint debt: unused imports and intelligence package/RPC naming issues outside this diff

Review Gates

  • Baseline reviewer: clean; scope is limited to proto comments, generated OpenAPI artifacts, and a generated-doc guard.
  • Code Review Expert: clean; no runtime/auth/data-write/security-sensitive paths touched.
  • Outcome Reviewer: approved initially and after the Greptile follow-up.
  • Greptile: two P2 findings fixed in follow-up commit 983102a6 (removed redundant inline fuel_mode comment; added placeholder rejection for query params). Final checks pass.

Documentation

Generated API documentation updated in docs/api/*.openapi.{json,yaml} and docs/api/worldmonitor.openapi.yaml. No prose docs required.

Screenshots / UI Evidence

Not applicable. This is generated API documentation/proto metadata only; no UI changed.

Residual Findings

  • make lint remains blocked by existing unrelated repo-wide proto lint debt outside this issue. The focused source scan and generated OpenAPI guard cover this PR's acceptance criteria.
  • GitHub still shows one unresolved Greptile thread for the placeholder query-description guard, but the requested guard is implemented in current head 983102a6; I did not resolve or reply to review threads per loop rules.

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Ready Ready Preview, Comment Jul 2, 2026 1:02pm

Request Review

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fills the 74 empty OpenAPI query-parameter descriptions identified in #4606 by adding leading proto comments to every previously-undocumented (sebuf.http.query) field across 37 proto files, then regenerating all per-service and unified OpenAPI specs. It also extends the CI description guard to fail when any generated query parameter lacks a description, and retires five allowlist entries that are now covered.

  • Proto comments: Leading comments added to all affected query fields across economic, forecast, imagery, infrastructure, intelligence, market, military, natural, resilience, sanctions, supply-chain, thermal, and webcam services.
  • Generated artifacts: All 26 per-service JSON/YAML files and the unified worldmonitor.openapi.yaml regenerated; 341 query parameters now carry descriptions.
  • Guard extension: collectQueryParameters() added to the test suite; 5 stale allowlist entries retired.

Confidence Score: 4/5

Safe to merge; changes are limited to proto documentation comments and their regenerated OpenAPI artifacts with no runtime code paths touched.

The proto comments and regenerated OpenAPI files are accurate and mechanically consistent. The new CI guard closes the documentation gap cleanly. Two minor issues: a redundant trailing inline comment on fuel_mode in compute_energy_shock.proto (the leading comment already covers it), and the new query-parameter guard omits the placeholder-description check that the existing high-risk property test applies — meaning a "TODO" comment in proto would pass the new guard.

tests/generated-api-description-guard.test.mjs — the new query-param guard could be hardened to reject placeholder descriptions the same way the existing high-risk property guard does.

Important Files Changed

Filename Overview
tests/generated-api-description-guard.test.mjs Adds new collectQueryParameters() guard that enforces non-empty descriptions on all generated OpenAPI query parameters; removes 5 now-fixed allowlist entries. Minor gap: placeholder detection (TODO/TBD) is not applied to query params the way it is to high-risk schema properties.
proto/worldmonitor/intelligence/v1/compute_energy_shock.proto Adds leading proto comments to all four query fields; fuel_mode now has both a leading comment and a redundant trailing inline comment.
proto/worldmonitor/military/v1/list_military_bases.proto Adds clear leading comments to all 8 bounding-box/filter query fields; descriptions are accurate and consistent.
proto/worldmonitor/market/v1/analyze_stock.proto Adds leading comments to symbol, name, and include_news query fields; clean and accurate.
docs/api/worldmonitor.openapi.yaml Unified OpenAPI spec regenerated to include 148 lines of new description fields; changes are mechanical and consistent with the per-service YAML files.
docs/api/MarketService.openapi.yaml Adds descriptions to all previously-undocumented query parameters across analyze/backtest/history/earnings/insider endpoints; content matches proto comments exactly.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[proto/*.proto\nAdd leading comments to\nquery fields] --> B[make generate\nbuf + sebuf plugins]
    B --> C[docs/api/*.openapi.json\nPer-service JSON specs\n341 query params described]
    B --> D[docs/api/*.openapi.yaml\nPer-service YAML specs]
    B --> E[docs/api/worldmonitor.openapi.yaml\nUnified spec]
    C --> F[generated-api-description-guard.test.mjs\ncollectQueryParameters guard\nFails CI if any query param\nlacks a description]
    C --> G[LEGACY_HIGH_RISK_DESCRIPTION_GAPS\nRemove 5 stale entries\nnow covered by new comments]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[proto/*.proto\nAdd leading comments to\nquery fields] --> B[make generate\nbuf + sebuf plugins]
    B --> C[docs/api/*.openapi.json\nPer-service JSON specs\n341 query params described]
    B --> D[docs/api/*.openapi.yaml\nPer-service YAML specs]
    B --> E[docs/api/worldmonitor.openapi.yaml\nUnified spec]
    C --> F[generated-api-description-guard.test.mjs\ncollectQueryParameters guard\nFails CI if any query param\nlacks a description]
    C --> G[LEGACY_HIGH_RISK_DESCRIPTION_GAPS\nRemove 5 stale entries\nnow covered by new comments]
Loading

Reviews (1): Last reviewed commit: "docs(api): fill generated query descript..." | Re-trigger Greptile

Comment on lines 13 to 14
// Fuel mode to model: "oil", "gas", or "both". Defaults to "oil".
string fuel_mode = 4 [(sebuf.http.query) = {name: "fuel_mode"}]; // "oil"|"gas"|"both", default "oil"

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.

P2 The trailing inline comment on fuel_mode is now redundant — the leading proto comment added in this PR already documents the valid values and default. The duplicate inline comment will not be surfaced in generated OpenAPI (only leading comments are picked up by buf generate) and adds maintenance noise if the accepted values ever change.

Suggested change
// Fuel mode to model: "oil", "gas", or "both". Defaults to "oil".
string fuel_mode = 4 [(sebuf.http.query) = {name: "fuel_mode"}]; // "oil"|"gas"|"both", default "oil"
// Fuel mode to model: "oil", "gas", or "both". Defaults to "oil".
string fuel_mode = 4 [(sebuf.http.query) = {name: "fuel_mode"}];

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +257 to +268
it('requires every generated query parameter to have a description', () => {
const missingDescriptions = collectQueryParameters()
.filter((row) => !row.description)
.map((row) => row.key)
.sort();

assert.deepEqual(
missingDescriptions,
[],
'Generated OpenAPI query parameters are missing descriptions:\n' + missingDescriptions.join('\n'),
);
});

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.

P2 The new query-parameter guard checks that every description is non-empty, but unlike the existing rejects placeholder descriptions test for high-risk schema properties, it does not apply MISLEADING_DESCRIPTION_PATTERNS (which catches "TODO", "TBD", bare type names, etc.). A query field with // TODO: fill later in proto would pass this guard. Applying the same placeholder check keeps the two guards consistent.

Suggested change
it('requires every generated query parameter to have a description', () => {
const missingDescriptions = collectQueryParameters()
.filter((row) => !row.description)
.map((row) => row.key)
.sort();
assert.deepEqual(
missingDescriptions,
[],
'Generated OpenAPI query parameters are missing descriptions:\n' + missingDescriptions.join('\n'),
);
});
it('requires every generated query parameter to have a description', () => {
const missingDescriptions = collectQueryParameters()
.filter((row) => !row.description)
.map((row) => row.key)
.sort();
assert.deepEqual(
missingDescriptions,
[],
'Generated OpenAPI query parameters are missing descriptions:\n' + missingDescriptions.join('\n'),
);
const placeholders = collectQueryParameters()
.filter((row) => row.description && MISLEADING_DESCRIPTION_PATTERNS.some((pattern) => pattern.test(row.description)))
.map((row) => `${row.key}: ${row.description}`)
.sort();
assert.deepEqual(
placeholders,
[],
'Generated OpenAPI query parameters have placeholder descriptions:\n' + placeholders.join('\n'),
);
});

@mintlify

mintlify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
WorldMonitor 🟢 Ready View Preview Jul 1, 2026, 10:10 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

- mark ignored calendar and natural-event query params as accepted-but-ignored no-ops

- cover bundled worldmonitor.openapi.yaml in the generated query-description guard
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