Skip to content

List an OpenAPI description among the contents of a directory - #1333

Merged
jviotti merged 2 commits into
mainfrom
openapi-list
Nov 20, 2026
Merged

jviotti merged 2 commits into
mainfrom
openapi-list

Conversation

@jviotti

@jviotti jviotti commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

View guided diff

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@github-actions github-actions 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.

Benchmark (community)

Details
Benchmark suite Current: 290cefc Previous: 2685e21 Ratio
Add one schema (0 existing) 283 ms 186 ms 1.52
Add one schema (100 existing) 47 ms 36 ms 1.31
Add one schema (1000 existing) 93 ms 83 ms 1.12
Add one schema (10000 existing) 739 ms 764 ms 0.97
Update one schema (1 existing) 36 ms 27 ms 1.33
Update one schema (101 existing) 45 ms 35 ms 1.29
Update one schema (1001 existing) 93 ms 104 ms 0.89
Update one schema (10001 existing) 722 ms 713 ms 1.01
Cached rebuild (1 existing) 15 ms 11 ms 1.36
Cached rebuild (101 existing) 16 ms 14 ms 1.14
Cached rebuild (1001 existing) 42 ms 35 ms 1.20
Cached rebuild (10001 existing) 316 ms 269 ms 1.17
Index 100 schemas 478 ms 326 ms 1.47
Index 1000 schemas 1925 ms 968 ms 1.99
Index 10000 schemas 12865 ms 9701 ms 1.33
Index 10000 schemas (custom meta-schema) 16539 ms 12287 ms 1.35
Index 10000 schemas ($ref fan-out) 14927 ms 11547 ms 1.29
test/e2e/html: Schema Fetch (p50) 396 us 227 us 1.74
test/e2e/html: Schema Fetch (p99) 487 us 379 us 1.28

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions 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.

Benchmark (enterprise)

Details
Benchmark suite Current: 290cefc Previous: 2685e21 Ratio
Add one schema (0 existing) 397 ms 443 ms 0.90
Add one schema (100 existing) 95 ms 108 ms 0.88
Add one schema (1000 existing) 154 ms 164 ms 0.94
Add one schema (10000 existing) 871 ms 1183 ms 0.74
Update one schema (1 existing) 84 ms 94 ms 0.89
Update one schema (101 existing) 91 ms 106 ms 0.86
Update one schema (1001 existing) 154 ms 168 ms 0.92
Update one schema (10001 existing) 877 ms 1044 ms 0.84
Cached rebuild (1 existing) 13 ms 14 ms 0.93
Cached rebuild (101 existing) 16 ms 15 ms 1.07
Cached rebuild (1001 existing) 42 ms 38 ms 1.11
Cached rebuild (10001 existing) 289 ms 308 ms 0.94
Index 100 schemas 529 ms 702 ms 0.75
Index 1000 schemas 1437 ms 1707 ms 0.84
Index 10000 schemas 12285 ms 15010 ms 0.82
Index 10000 schemas (custom meta-schema) 12741 ms 15561 ms 0.82
Index 10000 schemas ($ref fan-out) 18240 ms 19989 ms 0.91
enterprise/e2e/auth: Schema Anonymous (p50) 220 us 288 us 0.76
enterprise/e2e/auth: Schema Anonymous (p99) 305 us 366 us 0.83
enterprise/e2e/auth: Schema API Key Identity (p50) 224 us 291 us 0.77
enterprise/e2e/auth: Schema API Key Identity (p99) 300 us 364 us 0.82
enterprise/e2e/auth: Schema API Key SHA256 (p50) 227 us 295 us 0.77
enterprise/e2e/auth: Schema API Key SHA256 (p99) 302 us 372 us 0.81
enterprise/e2e/auth: Schema JWT (p50) 322 us 406 us 0.79
enterprise/e2e/auth: Schema JWT (p99) 441 us 511 us 0.86
test/e2e/html: Schema Fetch (p50) 225 us 295 us 0.76
test/e2e/html: Schema Fetch (p99) 325 us 353 us 0.92

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti
jviotti marked this pull request as ready for review November 20, 2026 12:56

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 24 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/index/explorer.h">

<violation number="1" location="src/index/explorer.h:191">
P1: Adding this packed field is not backward-compatible with persisted `directory.metapack` artifacts: incremental upgrades can misread existing paths/counts or hit the new missing-field assertion. Version/invalidate the directory extension and rebuild old artifacts before interpreting them with the new layout.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread src/index/explorer.h
MetapackVersionInfo version;
std::int64_t health;
std::int64_t schemas;
std::int64_t openapi;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Adding this packed field is not backward-compatible with persisted directory.metapack artifacts: incremental upgrades can misread existing paths/counts or hit the new missing-field assertion. Version/invalidate the directory extension and rebuild old artifacts before interpreting them with the new layout.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/index/explorer.h, line 191:

<comment>Adding this packed field is not backward-compatible with persisted `directory.metapack` artifacts: incremental upgrades can misread existing paths/counts or hit the new missing-field assertion. Version/invalidate the directory extension and rebuild old artifacts before interpreting them with the new layout.</comment>

<file context>
@@ -188,6 +188,7 @@ struct MetapackDirectoryExtension {
   MetapackVersionInfo version;
   std::int64_t health;
   std::int64_t schemas;
+  std::int64_t openapi;
   std::uint16_t path_length;
   std::uint16_t title_length;
</file context>

Comment thread src/index/explorer.h Resolved
@augmentcode

augmentcode Bot commented Nov 20, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Makes ingested OpenAPI descriptions discoverable in directory listings.

  • Adds an OpenAPI entry type alongside directories and schemas.
  • Includes document paths, identifiers, sizes, dialects, and descriptive metadata.
  • Exposes OpenAPI revision, API version, and operation counts.
  • Orders OpenAPI entries separately using version-aware sorting.
  • Applies existing privacy annotations to OpenAPI entries.
  • Reuses unchanged OpenAPI entries during incremental builds.
  • Adds recursive OpenAPI totals to directory JSON and metapack headers.
  • Extends the listing response contract and REST/MCP examples.
  • Updates end-to-end assertions for counts, entries, and schema resource sizes.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/index/explorer.h
"private", make_private(authentication,
child_registry_path(directory_registry_path,
entry.name)));
entries.push_back(std::move(entry.json));

@augmentcode augmentcode Bot Nov 20, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could we check HTML navigation for the entries appended at src/index/explorer.h:1880? make_file_manager_row links their extensionless path, but ACTION_WEB_SCHEMA only generates HTML artifacts for schemas, so clicking /test/openapi-petstore in the standard explorer now returns 404.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread src/index/explorer.h
const std::uint8_t *base) -> sourcemeta::core::JSON {
auto result{sourcemeta::core::JSON::make_object()};
result.assign("name", sourcemeta::core::JSON{name});
result.assign("type", sourcemeta::core::JSON{"openapi"});

@augmentcode augmentcode Bot Nov 20, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could we check the experimental directory browser against the new type at src/index/explorer.h:1444? ui/src/components/DirectoryNode.tsx:28–55 treats every non-schema entry as a directory, so OpenAPI documents appear as expandable folders; clicking openapi-petstore requests /self/v1/api/list/test/openapi-petstore and silently collapses the row on 404.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti merged commit f24e0c6 into main Nov 20, 2026
6 checks passed
@jviotti
jviotti deleted the openapi-list branch November 20, 2026 14:40
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