Skip to content

Refuse to build over an output directory that something else modified - #1183

Merged
jviotti merged 4 commits into
mainfrom
index-bugs
Jul 31, 2026
Merged

Refuse to build over an output directory that something else modified#1183
jviotti merged 4 commits into
mainfrom
index-bugs

Conversation

@jviotti

@jviotti jviotti commented Jul 31, 2026

Copy link
Copy Markdown
Member

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

Review in cubic

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

augmentcode Bot commented Jul 31, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR makes the indexer fail fast when its output directory has been modified externally, rather than continuing an incremental build with missing cached artifacts.

Changes:

  • Documents “Output Directory” ownership/constraints in the CLI help text (and updates help-output tests accordingly).
  • Adds ResolverMissingCachedArtifactError to represent a cache-hit whose on-disk artifact is missing.
  • Replaces a debug-only assertion in Resolver::emplace with a runtime check that throws the new error when the cached artifact path no longer exists.
  • Catches the new error in the CLI entrypoint and prints a clear recovery instruction (delete output dir and re-index).
  • Adds a CLI regression test that simulates deleting a schema artifact between runs.
  • Adds unit tests covering both the success path (artifact present) and the failure path (artifact missing) for Resolver::emplace.

Technical Notes: The new behavior enforces the assumption that the output directory is exclusively managed by the indexer to keep incremental builds consistent.

🤖 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. 1 suggestion posted.

Fix All in Augment

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

Comment thread src/resolver/resolver.cc Outdated
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

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

Review completed against the latest diff

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

Re-trigger cubic

Comment thread src/index/index.cc
jviotti added 2 commits July 31, 2026 19:13
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
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 Index (community)

Details
Benchmark suite Current: d5a4e87 Previous: 868f8a0 Ratio
Add one schema (0 existing) 248 ms 320 ms 0.78
Add one schema (100 existing) 27 ms 30 ms 0.90
Add one schema (1000 existing) 98 ms 86 ms 1.14
Add one schema (10000 existing) 911 ms 733 ms 1.24
Update one schema (1 existing) 18 ms 21 ms 0.86
Update one schema (101 existing) 26 ms 29 ms 0.90
Update one schema (1001 existing) 100 ms 86 ms 1.16
Update one schema (10001 existing) 919 ms 734 ms 1.25
Cached rebuild (1 existing) 6 ms 7 ms 0.86
Cached rebuild (101 existing) 9 ms 9 ms 1
Cached rebuild (1001 existing) 33 ms 29 ms 1.14
Cached rebuild (10001 existing) 291 ms 249 ms 1.17
Index 100 schemas 378 ms 645 ms 0.59
Index 1000 schemas 1401 ms 1471 ms 0.95
Index 10000 schemas 13430 ms 14057 ms 0.96
Index 10000 schemas (custom meta-schema) 15384 ms 16806 ms 0.92
Index 10000 schemas ($ref fan-out) 15704 ms 16686 ms 0.94

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

@jviotti
jviotti merged commit 86e4407 into main Jul 31, 2026
5 checks passed
@jviotti
jviotti deleted the index-bugs branch July 31, 2026 22:51

@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 Index (enterprise)

Details
Benchmark suite Current: d5a4e87 Previous: 868f8a0 Ratio
Add one schema (0 existing) 400 ms 263 ms 1.52
Add one schema (100 existing) 106 ms 262 ms 0.40
Add one schema (1000 existing) 163 ms 126 ms 1.29
Add one schema (10000 existing) 826 ms 941 ms 0.88
Update one schema (1 existing) 96 ms 110 ms 0.87
Update one schema (101 existing) 102 ms 75 ms 1.36
Update one schema (1001 existing) 165 ms 176 ms 0.94
Update one schema (10001 existing) 889 ms 730 ms 1.22
Cached rebuild (1 existing) 9 ms 5 ms 1.80
Cached rebuild (101 existing) 11 ms 6 ms 1.83
Cached rebuild (1001 existing) 37 ms 17 ms 2.18
Cached rebuild (10001 existing) 315 ms 154 ms 2.05
Index 100 schemas 697 ms 1138 ms 0.61
Index 1000 schemas 1547 ms 1571 ms 0.98
Index 10000 schemas 13615 ms 10542 ms 1.29
Index 10000 schemas (custom meta-schema) 16764 ms 14967 ms 1.12
Index 10000 schemas ($ref fan-out) 16674 ms 15585 ms 1.07

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

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