Define durable index identity and catalog #21
No reviewers
Labels
No labels
area/cli
area/core
area/database
area/indexing
area/query
type/epic
type/feature
type/foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
JayKobe6k/ClariTree!21
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-4-index-catalog"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Tests
nix develop --command cargo fmt --all -- --checknix develop --command cargo lintnix develop --command cargo test --all-targets --all-featuresnix develop --command cargo doc --no-deps --all-featuresnix develop --command cargo check --target x86_64-pc-windows-gnu --all-targets --all-featuresCloses #4
Found three actionable issues in catalog persistence and project identity handling.
@ -0,0 +117,4 @@return Err(GitOriginError::CredentialsNotAllowed);}if !url.username().is_empty() {url.set_username("").map_err(|()| GitOriginError::Invalid {[P1] SSH URL normalization drops the username even though this normalized origin is the only stored fetch location. A valid remote such as
ssh://deploy@example.com/repo.gitis persisted asssh://example.com/repo, so reopening the project can authenticate as the wrong account and fail. Please preserve the user information needed to reproduce the fetch URL while keeping identity normalization deterministic.@ -0,0 +972,4 @@.load()?.indexes().iter().any(|existing| existing.id() == index.id())[P1] Registration checks only for an existing index ID; it does not reject a different index that reuses the same
database_path. Because later lookup opens the database through this mapping, two catalog entries can alias one store and silently expose or overwrite each other's index. Please enforce database-path uniqueness and return a typed conflict before publishing the catalog.@ -0,0 +1126,4 @@detail: source.to_string(),});}sync_catalog_directory(&self.directory)[P1] Once
hard_linksucceeds, the new catalog file is already visible, but a subsequent directory-sync failure is returned as if the save had not committed. A caller that cleans up the newly built database after this error leaves the durable catalog pointing at missing data, while a retry can also observe the supposedly failed write. Please treat publication as a commit point and surface post-commit durability status separately, or use a protocol that can roll back safely.Review comment #925: Fixed in
374e5f9. Registration and activation now reject typed duplicate database-path conflicts across every index and historical revision; catalog construction enforces the same invariant. Validation: focused historical-revision regression and the complete 54-test suite plus zlib E2E passed.Review comment #921: Fixed in
374e5f9. Post-hard-link directory-sync failure now returns a committed-but-durability-unconfirmed publication status rather than an uncommitted error; a deterministic injected-sync regression verifies the entry remains visible. Validation: full formatting, lint, 54 unit tests plus zlib E2E, and rustdoc passed.Review comment #923: Fixed in
374e5f9.GitProjectSourcenow carries an exactGitFetchLocationseparately from normalizedGitOrigin, preserving SSH usernames without making credentials part of project identity; regression coverage checks both values. Validation: full formatting, lint, all-target/all-feature tests, and rustdoc passed.