fix(customer): keep malformed affiliate hierarchies visible - #907
Draft
seonghobae wants to merge 18 commits into
Draft
fix(customer): keep malformed affiliate hierarchies visible#907seonghobae wants to merge 18 commits into
seonghobae wants to merge 18 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Buyer-visible defect
The post-detail Affiliate Tree must preserve every authorized organization/person observation when hierarchy data is malformed or partially unresolved, without broadening metadata reads or inventing corporate authority.
Current repairs cover pure cycles, self-parent pointers, unavailable parents, bounded ancestor/alias reads, unavailable entity references with identical display names, and conflicting duplicate canonical entity rows.
TDD / repairs
f614ff65fc34bd87635217b8dd9ff92c93d9d025→ GREENca9031fcb6441da26333286f81eea91fe79acbd0: cycle/self-parent/missing-parent records remain visible with deterministic disclosure.dcf6ddec8b6ce32f32705fe5e761c4eea367dbb2→ GREEN076e87325dd2d9e7a8adc55f56986d39b1266b9a.dc0ea5a66e15c1a8db1d55bd1a03aacd7b939a99→ GREENa0fd03daf03fb7363c0398a6f720bfd056a3d9a1+3be6ec3249d65e55c03a12a21c3940273e95a36c.44d8effb3fb0be7740c1441f21295c4b601d2a64→ GREEN0902c402f29c6be4dbf1a5877dfce9924e6a693a: unresolved roots retain opaque source entity references and do not collapse by display name.f25f479502dd96b5eff4213a1f975091f0a275fd: two availableCorporateEntityRowvalues with oneentity_idmust not be collapsed by dict last-wins semantics.c12b3f3501d7bca61691386cbdc5c099f6c2f761:_index_entities()fails closed before hierarchy construction when a canonical entity ID is duplicated. A focused exact-logic probe confirms the duplicate rejection while preserving the ordinary one-row index contract.Duplicate available entity rows are not treated like an unavailable parent edge: choosing one row would let database/input order select business truth. The repair therefore rejects the ambiguous snapshot rather than fabricating a resolved hierarchy. The ingestion boundary remains bounded to this post's touched entity/name set.
Scope / ownership
This PR owns
lineageweave/affiliate_tree.py, the post-detail Affiliate Tree ingestion path, and its bounded organization-alias lookup. It does not modify Customer Master (#909), source-system corporate authority, another repository's persistence, or authorization scope.Exact live identity / governance
main@3f61c8242b9c02dec307a7396e83e28f7cdd9f3dc12b3f3501d7bca61691386cbdc5c099f6c2f76133568582495, Security33568582394, SAST33568582650: queued and therefore non-passing