Skip to content

Compute search index out of the directory metadata#753

Merged
jviotti merged 3 commits intomainfrom
search-directory-list
Mar 19, 2026
Merged

Compute search index out of the directory metadata#753
jviotti merged 3 commits intomainfrom
search-directory-list

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Mar 18, 2026

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti changed the title [WIP] Compute search index out of the directory metadata Compute search index out of the directory metadata Mar 18, 2026
@jviotti jviotti marked this pull request as ready for review March 18, 2026 21:17
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (enterprise)

Details
Benchmark suite Current: cd99d84 Previous: 6d683a9 Ratio
Add one schema (0 existing) 23 ms 27 ms 0.85
Add one schema (100 existing) 34 ms 36 ms 0.94
Add one schema (1000 existing) 154 ms 162 ms 0.95
Add one schema (10000 existing) 1540 ms 1661 ms 0.93
Update one schema (1 existing) 21 ms 22 ms 0.95
Update one schema (101 existing) 33 ms 35 ms 0.94
Update one schema (1001 existing) 154 ms 160 ms 0.96
Update one schema (10001 existing) 1544 ms 1610 ms 0.96
Cached rebuild (1 existing) 12 ms 12 ms 1
Cached rebuild (101 existing) 13 ms 14 ms 0.93
Cached rebuild (1001 existing) 31 ms 32 ms 0.97
Cached rebuild (10001 existing) 228 ms 237 ms 0.96
Index 100 schemas 142 ms 146 ms 0.97
Index 1000 schemas 1418 ms 1175 ms 1.21
Index 10000 schemas 18227 ms 15663 ms 1.16

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

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

augmentcode bot commented Mar 18, 2026

🤖 Augment PR Summary

Summary: This PR changes how the Explorer search index is produced by deriving it from directory listing metadata rather than per-schema metapack extensions.

Changes:

  • Removed the global/aggregate SearchIndex build rule and replaced it with a root-only directory rule (search.metapack).
  • Introduced DirectoryDependencyKind::AllDirectoryListings and implemented its dependency expansion in the build delta planner.
  • Updated GENERATE_EXPLORER_SEARCH_INDEX to read directory.metapack JSON and collect schema entries’ path/title/description from entries.
  • Adjusted CLI golden outputs and unit tests to reflect the new build DAG ordering and dependency edges.

Technical Notes: Dependency tracking for search.metapack now flows through directory listing targets, which centralizes schema metadata consumption in directory.metapack rather than reading schema extensions directly.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

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

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 18 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/build/delta.cc">

<violation number="1" location="src/build/delta.cc:988">
P1: `AllDirectoryListings` iterates over `affected_dirs`, which only contains directories derived from dirty/affected schemas. During an incremental rebuild where only one nested schema changes, unrelated directories won't appear in `affected_dirs`, so their `directory.metapack` files won't be listed as dependencies for the `SearchIndex` action. This can cause schemas from those unaffected directories to be silently dropped from `search.metapack`.</violation>

<violation number="2" location="src/build/delta.cc:993">
P3: `DIRECTORY_RULES[0].filename` relies on array ordering to access the `DirectoryList` rule. If the `DIRECTORY_RULES` array is ever reordered, this will silently reference the wrong target filename. Consider looking up the rule by its action type instead of using a magic index.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (community)

Details
Benchmark suite Current: cd99d84 Previous: 6d683a9 Ratio
Add one schema (0 existing) 26 ms 22 ms 1.18
Add one schema (100 existing) 39 ms 35 ms 1.11
Add one schema (1000 existing) 195 ms 164 ms 1.19
Add one schema (10000 existing) 2147 ms 1702 ms 1.26
Update one schema (1 existing) 24 ms 19 ms 1.26
Update one schema (101 existing) 39 ms 34 ms 1.15
Update one schema (1001 existing) 191 ms 160 ms 1.19
Update one schema (10001 existing) 2637 ms 1670 ms 1.58
Cached rebuild (1 existing) 12 ms 11 ms 1.09
Cached rebuild (101 existing) 14 ms 13 ms 1.08
Cached rebuild (1001 existing) 37 ms 31 ms 1.19
Cached rebuild (10001 existing) 509 ms 244 ms 2.09
Index 100 schemas 155 ms 154 ms 1.01
Index 1000 schemas 1523 ms 1235 ms 1.23
Index 10000 schemas 19060 ms 15919 ms 1.20

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit 486f3d5 into main Mar 19, 2026
6 checks passed
@jviotti jviotti deleted the search-directory-list branch March 19, 2026 13:22
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