From 041ab4f287095422d34662057f9b0bd513a591b6 Mon Sep 17 00:00:00 2001 From: devmrko Date: Tue, 28 Jul 2026 13:39:33 +0900 Subject: [PATCH] refs #739: separate catalog and fact availability --- .../design/739-game-target-contract/README.md | 5 ++++ .../86_sgmp_game_scope_profile_guidance.sql | 2 +- .../87_sgmp_std09_catalog_fact_boundary.sql | 23 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 sql/adb/87_sgmp_std09_catalog_fact_boundary.sql diff --git a/docs/design/739-game-target-contract/README.md b/docs/design/739-game-target-contract/README.md index 14dc464..a086bbc 100644 --- a/docs/design/739-game-target-contract/README.md +++ b/docs/design/739-game-target-contract/README.md @@ -155,6 +155,11 @@ Few-shot 원문 SQL은 실행 이력 그대로 검색하지 않는다. 특히 AI 프로파일의 `additional_instructions`로 관리한다. 애플리케이션은 계획 전달과 read-only·객체 범위 검증만 담당한다. +공통 거래처럼 게임 식별 컬럼이 있는 객체는 게임 식별자를 SQL 리터럴로 직접 넣지 +않는다. 활성 게임 별칭 카탈로그를 통해 허용 식별자를 구하는 서브쿼리 또는 `EXISTS` +조건을 사용하며, 카탈로그에는 있으나 해당 공통 객체의 데이터가 없는 경우는 다른 +게임으로 대체하지 않고 빈 결과 또는 집계 `NULL`을 그대로 보존한다. + 기존 예제는 삭제하지 않는다. 실행 가능성, 게임 범위 일치, 물리 객체 의존성을 전수 검사해 `RETIRED`로 분리하고, 검증된 정규화 예제만 `APPROVED`로 전환한다. diff --git a/sql/adb/86_sgmp_game_scope_profile_guidance.sql b/sql/adb/86_sgmp_game_scope_profile_guidance.sql index df539cd..4160600 100644 --- a/sql/adb/86_sgmp_game_scope_profile_guidance.sql +++ b/sql/adb/86_sgmp_game_scope_profile_guidance.sql @@ -7,7 +7,7 @@ BEGIN attribute_name => 'additional_instructions', attribute_value => q'~Generate Oracle SQL only for the listed approved objects. Do not reference external tables. Use English aliases only. Use database comments and annotations as the source of business rules. -When an authoritative game query plan is supplied in the user request, use its targets and statuses as the only game-scope source; do not independently rematch a game, infer a default game, or substitute one target's object for another. A plan with no selected game does not by itself prohibit a query: use an approved common object when it can answer the operation. If an operation inherently requires a game-scoped logical object and the relevant plan target is unresolved or its physical object is unavailable, return an appropriate zero-row result. A zero-row result is not a synthetic row containing a NULL value and is not an execution failure. For multiple or all resolved targets, use the supplied target identifiers to group a common object when applicable, or combine only the supplied available objects. Never invent identifiers, prefixes, or physical object names.~' +When an authoritative game query plan is supplied in the user request, use its targets and statuses as the only game-scope source; do not independently rematch a game, infer a default game, or substitute one target's object for another. A plan with no selected game does not by itself prohibit a query: use an approved common object when it can answer the operation. If an operation inherently requires a game-scoped logical object and the relevant plan target is unresolved or its physical object is unavailable, return an appropriate zero-row result. A zero-row result is not a synthetic row containing a NULL value and is not an execution failure. For multiple or all resolved targets, use the supplied target identifiers to group a common object when applicable, or combine only the supplied available objects. When filtering an approved common object by game, derive the allowed game identifiers through the active approved game-alias catalog lookup; do not put a game identifier or prefix directly as a SQL literal predicate. Preserve an alias lookup with no matching data as an empty or aggregate-null result, never as a substituted game. Never invent identifiers, prefixes, or physical object names.~' ); END; / diff --git a/sql/adb/87_sgmp_std09_catalog_fact_boundary.sql b/sql/adb/87_sgmp_std09_catalog_fact_boundary.sql new file mode 100644 index 0000000..ff91c87 --- /dev/null +++ b/sql/adb/87_sgmp_std09_catalog_fact_boundary.sql @@ -0,0 +1,23 @@ +-- Benchmark correction: game-catalog resolution and fact-row availability are distinct. +-- Korean text is reconstructed from UTF-8 base64 so SQLcl cannot corrupt it. + +UPDATE sg_ai_qa_question + SET expected_focus = utl_i18n.raw_to_char( + utl_encode.base64_decode(utl_raw.cast_to_raw( + '6rKM7J6EIOuzhOy5rSDsubTtg4jroZzqt7jsl5DshJwg7ZmV7J2465CcIOqyjOyehOydgCDqs7XthrUg66ek7LacIOqwneyytOydmCBHQU1FX0lE66W8IOuzhOy5rSDsubTtg4jroZzqt7ggRVhJU1RTL+yEnOu4jOy/vOumrOuhnCDsl7DqsrDtlZzri6QuIEdBTUVfSUTrgpggcHJlZml466W8IOyngeygkSDrpqzthLDrn7TroZwg6rOg7KCV7ZWY7KeAIOyViuuKlOuLpC4g7Lm07YOI66Gc6re4IOunpOy5reqzvCDtlbTri7kg66ek7LacIOyCrOyLpCDrjbDsnbTthLAg7KG07J6sIOyXrOu2gOuKlCDrs4TqsJzsnbTrqbAsIOunpOy5reuQmOyXiOyngOunjCDtlbTri7kg7J287J6QIOunpOy2nCDtlonsnbQg7JeG7Jy866m0IOynkeqzhCBOVUxMIOuYkOuKlCAw6rG07J2AIOygleyDgSDqsrDqs7zri6QuIOyehOydmOydmCDri6Trpbgg6rKM7J6E7Jy866GcIOuMgOyytO2VmOyngCDslYrripTri6Qu' + )), + 'AL32UTF8' + ) + WHERE question_code = 'STD-09'; + +UPDATE sg_qa_vector_example + SET inspection_status = 'REVIEW', + inspection_note = 'Customer benchmark criterion updated: catalog resolution and common-fact availability are evaluated separately.' + WHERE source_type = 'CUSTOMER_QA_BENCHMARK' + AND source_case_id = 'STD-09'; + +COMMIT; + +SELECT question_code, expected_focus + FROM sg_ai_qa_question + WHERE question_code = 'STD-09';