Skip to content

Fix potential inconsistencies when removing schemas with references#748

Merged
jviotti merged 2 commits intomainfrom
removal-tests
Mar 18, 2026
Merged

Fix potential inconsistencies when removing schemas with references#748
jviotti merged 2 commits intomainfrom
removal-tests

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>
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 6 files

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

augmentcode bot commented Mar 18, 2026

🤖 Augment PR Summary

Summary: This PR hardens incremental indexing when schemas are removed in the presence of cross-schema references.

Changes:

  • In the Combine phase, detects deleted dependencies.metapack entries and rebuilds dependents.metapack for schemas that were referenced by the removed schema.
  • Adds BuildState::raw_disk_entry() to read prior on-disk entries even when they’ve been marked deleted in the overlay.
  • Adds BuildState::deleted_keys() so delta planning can enumerate removed output keys.
  • Computes a removed_entries set for outputs belonging to schemas no longer present, and uses it to propagate dirtiness through dependency graphs.
  • Simplifies “potential stale output” detection to !removed_entries.empty().
  • Adds CLI regression tests for (1) removing a referenced schema (expected failure) and (2) removing a referencing schema (expected dependents rebuild).

Technical Notes: The change relies on per-schema /%/dependencies.metapack graphs to identify cross-schema relationships even when the owning schema’s outputs are being disposed.

🤖 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
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: 076bbbe Previous: 63171c9 Ratio
Add one schema (0 existing) 22 ms 22 ms 1
Add one schema (100 existing) 42 ms 39 ms 1.08
Add one schema (1000 existing) 192 ms 208 ms 0.92
Add one schema (10000 existing) 2002 ms 2012 ms 1.00
Update one schema (1 existing) 20 ms 21 ms 0.95
Update one schema (101 existing) 39 ms 44 ms 0.89
Update one schema (1001 existing) 209 ms 225 ms 0.93
Update one schema (10001 existing) 2291 ms 2307 ms 0.99
Cached rebuild (1 existing) 11 ms 11 ms 1
Cached rebuild (101 existing) 13 ms 13 ms 1
Cached rebuild (1001 existing) 30 ms 33 ms 0.91
Cached rebuild (10001 existing) 244 ms 259 ms 0.94

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: 076bbbe Previous: 63171c9 Ratio
Add one schema (0 existing) 19 ms 19 ms 1
Add one schema (100 existing) 32 ms 31 ms 1.03
Add one schema (1000 existing) 163 ms 136 ms 1.20
Add one schema (10000 existing) 1709 ms 1406 ms 1.22
Update one schema (1 existing) 18 ms 18 ms 1
Update one schema (101 existing) 32 ms 30 ms 1.07
Update one schema (1001 existing) 178 ms 157 ms 1.13
Update one schema (10001 existing) 2141 ms 1760 ms 1.22
Cached rebuild (1 existing) 10 ms 10 ms 1
Cached rebuild (101 existing) 11 ms 11 ms 1
Cached rebuild (1001 existing) 26 ms 23 ms 1.13
Cached rebuild (10001 existing) 199 ms 162 ms 1.23

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

@jviotti jviotti merged commit 943da3c into main Mar 18, 2026
6 checks passed
@jviotti jviotti deleted the removal-tests branch March 18, 2026 14:38
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