You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No issues found. Checked for bugs (race conditions, data corruption, logic errors, edge cases) — no significant problems introduced by this PR.
Notes:
The two potential concerns (parallel indexing race, raw/wiki name mismatch when file is already in raw/) were evaluated and determined to be false positives: the hash suffix prevents collisions in the normal code path, and lint.py's registry lookup correctly handles the naming indirection.
Pre-existing registry entries (from versions before this PR) have no doc_name, path, raw_path, or source_path fields, so neither get_by_path nor remove_by_doc_name can match them. On re-ingest of a file whose content has changed, the upgrade path silently leaks orphans: the new hashed doc_name is generated, remove_by_doc_name matches nothing (old entry has no doc_name to compare), and the new entry is added alongside the stale one. The old wiki/sources/<stem>.md / wiki/summaries/<stem>.md files are also left in place next to the new <stem>-<hash>.md outputs. No migration code is included.
remove_by_doc_name only matches entries whose metadata["doc_name"] == doc_name:
A one-time migration (backfill path/doc_name for existing entries based on name) or a fallback match by name in remove_by_doc_name would close this gap.
Thanks for surfacing and fixing this, @saccharin98 — the duplicate-name collision was a real bug. We ended up addressing it in #96 with a slightly different approach: document identity is keyed by path, and a colliding same-stem source gets a deterministic -{sha256(path)[:8]} suffix (plus legacy-entry backfill and a full regression test suite). Since #96 covers this case, we're closing it in favor of #96. Thanks again for the original report and patch! 🙏
…rwrite each other (#96)
* feat(state): index registry entries by path for doc identity
* feat(state): match legacy registry entries by stem for path backfill
* docs(state): document first-match-wins + truthy-path semantics in find_legacy_by_stem
* feat(converter): portable registry path key
* feat(converter): collision-resistant doc_name resolution (Scheme A)
* fix(converter,state): NFKC-normalize both sides of name comparisons + edge tests
* feat(converter): name all artifacts by collision-resistant doc_name
* fix(converter): registry-authoritative names; read-only dedup skip
Unclaimed on-disk artifacts no longer force a suffix (fixes doc_name
drift on retry after a failed compile), and the dedup early-return now
derives the name from the stored entry without invoking the resolver
(no legacy path backfill from duplicate copies).
* feat(indexer): accept explicit doc_name for long-doc artifacts
* feat(cli): persist path identity metadata on add
* fix(cli): construct registry after convert so legacy backfills aren't clobbered
* fix(lint): resolve raw files through the registry before stem matching
* fix(cli): remove locates raw copies via recorded raw_path
* fix(cli): restrict raw-name fallback to legacy entries without raw_path
* credit: collision-resistant doc_name groundwork
The identity model (path-keyed registry metadata, collision-resistant
naming) builds on the approach pioneered in PR #30.
Co-authored-by: Xinyan Zhou <xinyanzhou938@gmail.com>
---------
Co-authored-by: Xinyan Zhou <xinyanzhou938@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.