Skip to content

Fix various potential crashes in the indexer resolver#774

Merged
jviotti merged 1 commit intomainfrom
resolver-fixes
Mar 25, 2026
Merged

Fix various potential crashes in the indexer resolver#774
jviotti merged 1 commit intomainfrom
resolver-fixes

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Mar 25, 2026

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

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

augmentcode bot commented Mar 25, 2026

🤖 Augment PR Summary

Summary: This PR hardens the resolver/indexer path against malformed schema inputs that previously could trigger assertion failures or crashes.

Changes:

  • Introduces ResolverNotASchemaError and throws it when an imported file isn’t a valid JSON Schema.
  • Replaces assertion-only checks with explicit error handling for missing dialects (SchemaUnknownDialectError).
  • Makes reference normalization tolerant of non-string $ref/$dynamicRef values to avoid crashes.
  • Updates the CLI entrypoint to catch and report the new/propagated resolver errors.
  • Adds unit tests + fixtures for non-schema files, missing dialects, and non-string references.

🤖 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. No suggestions at this time.

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.

No issues found across 7 files

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: 6a558a5 Previous: 7a1e3b9 Ratio
Add one schema (0 existing) 20 ms 23 ms 0.87
Add one schema (100 existing) 24 ms 27 ms 0.89
Add one schema (1000 existing) 74 ms 79 ms 0.94
Add one schema (10000 existing) 614 ms 653 ms 0.94
Update one schema (1 existing) 18 ms 20 ms 0.90
Update one schema (101 existing) 24 ms 27 ms 0.89
Update one schema (1001 existing) 75 ms 85 ms 0.88
Update one schema (10001 existing) 631 ms 668 ms 0.94
Cached rebuild (1 existing) 10 ms 11 ms 0.91
Cached rebuild (101 existing) 12 ms 13 ms 0.92
Cached rebuild (1001 existing) 26 ms 28 ms 0.93
Cached rebuild (10001 existing) 194 ms 204 ms 0.95
Index 100 schemas 115 ms 118 ms 0.97
Index 1000 schemas 968 ms 1047 ms 0.92
Index 10000 schemas 13769 ms 14322 ms 0.96

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

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: 6a558a5 Previous: 7a1e3b9 Ratio
Add one schema (0 existing) 22 ms 22 ms 1
Add one schema (100 existing) 27 ms 27 ms 1
Add one schema (1000 existing) 76 ms 75 ms 1.01
Add one schema (10000 existing) 599 ms 628 ms 0.95
Update one schema (1 existing) 21 ms 21 ms 1
Update one schema (101 existing) 27 ms 27 ms 1
Update one schema (1001 existing) 78 ms 81 ms 0.96
Update one schema (10001 existing) 623 ms 636 ms 0.98
Cached rebuild (1 existing) 12 ms 12 ms 1
Cached rebuild (101 existing) 13 ms 13 ms 1
Cached rebuild (1001 existing) 29 ms 29 ms 1
Cached rebuild (10001 existing) 204 ms 209 ms 0.98
Index 100 schemas 161 ms 122 ms 1.32
Index 1000 schemas 1088 ms 1057 ms 1.03
Index 10000 schemas 13768 ms 14650 ms 0.94

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

@jviotti jviotti merged commit 5f7a697 into main Mar 25, 2026
6 checks passed
@jviotti jviotti deleted the resolver-fixes branch March 25, 2026 13:53
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