feat(ip): owner_check у досьє ТМ для фізосіб — фан-аут за ПІБ + skip-маркери - #2199
Open
teosoph wants to merge 1 commit into
Open
feat(ip): owner_check у досьє ТМ для фізосіб — фан-аут за ПІБ + skip-маркери#2199teosoph wants to merge 1 commit into
teosoph wants to merge 1 commit into
Conversation
…маркери
Раніше get_trademark_dossier виконував перевірку правовласника лише для
юросіб (owner_edrpou), а для фізосіб повертав голий null — не відрізняючи
«немає що перевіряти» від «сервіс недоступний» (кейс ТМ 67482).
- юрособа: як було (openreyestr_get_by_edrpou), але при падінні сервісу —
{ skipped: true, reason: 'service_unavailable' } замість null
- фізособа: best-effort фан-аут за ПІБ по 7 джерелах (боржники, виконавчі
провадження, банкрутства, санкції, ЄДР/ФОП, портфель ІВ, розклад засідань),
limit 10 на джерело; падіння окремого джерела не валить досьє
- збіги марковано match_basis: 'name_only' (можливі однофамільці — у реєстрі
ТМ немає РНОКПП) + owner_address з raw_data для ручної адресної звірки
- без власника взагалі: { skipped: true, reason: 'no_owner_identifier' }
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="mcp_backend/src/api/tools/ip-objects-tools.ts">
<violation number="1" location="mcp_backend/src/api/tools/ip-objects-tools.ts:473">
P2: `extractOwnerAddress` falls back to the raw `address` object when neither `FreeFormatAddress.FreeFormatAddressLine` nor `FreeFormatAddressLine` exists. The consumer (`owner_address` in the dossier) expects a string for the AI to use in address cross-checking; returning the entire address object would produce confusing output in that edge case.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| ?? raw?.ApplicantDetails?.Applicant?.[0]?.ApplicantAddressBook; | ||
| const address = party?.FormattedNameAddress?.Address; | ||
| if (!address) return null; | ||
| return address.FreeFormatAddress?.FreeFormatAddressLine ?? address.FreeFormatAddressLine ?? address; |
Contributor
There was a problem hiding this comment.
P2: extractOwnerAddress falls back to the raw address object when neither FreeFormatAddress.FreeFormatAddressLine nor FreeFormatAddressLine exists. The consumer (owner_address in the dossier) expects a string for the AI to use in address cross-checking; returning the entire address object would produce confusing output in that edge case.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At mcp_backend/src/api/tools/ip-objects-tools.ts, line 473:
<comment>`extractOwnerAddress` falls back to the raw `address` object when neither `FreeFormatAddress.FreeFormatAddressLine` nor `FreeFormatAddressLine` exists. The consumer (`owner_address` in the dossier) expects a string for the AI to use in address cross-checking; returning the entire address object would produce confusing output in that edge case.</comment>
<file context>
@@ -419,6 +421,58 @@ export class IpObjectsTools extends BaseToolHandler {
+ ?? raw?.ApplicantDetails?.Applicant?.[0]?.ApplicantAddressBook;
+ const address = party?.FormattedNameAddress?.Address;
+ if (!address) return null;
+ return address.FreeFormatAddress?.FreeFormatAddressLine ?? address.FreeFormatAddressLine ?? address;
+ }
+
</file context>
Suggested change
| return address.FreeFormatAddress?.FreeFormatAddressLine ?? address.FreeFormatAddressLine ?? address; | |
| return address.FreeFormatAddress?.FreeFormatAddressLine ?? address.FreeFormatAddressLine ?? null; |
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.
Проблема
get_trademark_dossierформувавowner_checkлише для юросіб (tm.owner_edrpou ? callTool('openreyestr_get_by_edrpou') : null). Для фізосіб-власників (owner_edrpou=null) повертався голийnull— перевірка правовласника не виконувалась взагалі, і неможливо було відрізнити «немає що перевіряти» від «сервіс недоступний». Кейс: ТМ 67482, власник Дьяконенко О.Є. Доробка зафіксована в клієнтських документах МСП як «деанонімізація + звірка за РНОКПП».Що зроблено
openreyestr_get_by_edrpou), але при недоступності сервісу тепер{ skipped: true, reason: 'service_unavailable' }замістьnull.tm.owner_name) по 7 джерелах:openreyestr_search_debtors,openreyestr_search_enforcement_proceedings,openreyestr_search_bankruptcy_cases,search_registry(registry=sanctions),openreyestr_search_entities(ФОП/участь у юрособах),search_ip_objects(портфель ІВ),search_court_hearing_schedule(participant, source=opendata). Кожне джерело — try/catch: недоступний сервіс дає{ skipped: true, reason: 'service_unavailable' }у своєму ключі й не валить досьє.match_basis: 'name_only'+ caveat (у реєстрі ТМ немає РНОКПП — можливі однофамільці) +owner_addressзraw_data(SIS HolderAddressBook/ApplicantAddressBook) для ручної адресної звірки.OWNER_FANOUT_LIMIT).{ skipped: true, reason: 'no_owner_identifier' }.guidanceдосьє доповнено інструкцією для розділу «Перевірка правовласника» (name_only → ймовірні збіги + адресна звірка).Тести
ip-objects-tools.test.ts(+5 кейсів, TDD): фізособа (безskipped, єprobable_matches, правильні аргументи фан-ауту, ліміти ≤10,openreyestr_get_by_edrpouне викликається), юрособа happy-path (як було), юрособа при падінні сервісу (service_unavailable), падіння одного джерела фан-ауту (маркер лише в ньому), відсутній власник (no_owner_identifier).🤖 Generated with Claude Code
Summary by cubic
Розширили owner_check у досьє ТМ: тепер працює і для фізосіб через фан-аут за ПІБ з чіткими skip-маркерами при недоступності сервісів. Для юросіб збережено перевірку за ЄДРПОУ, але замість null тепер повертаємо skip-маркер.
openreyestr_search_debtors,openreyestr_search_enforcement_proceedings,openreyestr_search_bankruptcy_cases,search_registry(registry='sanctions'),openreyestr_search_entities,search_ip_objects,search_court_hearing_schedule(source='opendata')).{ skipped: true, reason: 'service_unavailable' }, досьє не валиться.match_basis: 'name_only'+ попередження про однофамільців; додаємоowner_addressзraw_dataдля ручної звірки.openreyestr_get_by_edrpou; при недоступності сервісу —{ skipped: true, reason: 'service_unavailable' }.{ skipped: true, reason: 'no_owner_identifier' }.guidanceдля секції «Перевірка правовласника» (ймовірні збіги + адресна звірка).Written for commit 6254e8d. Summary will update on new commits.