refs #703 #704: finalize smilegate game data poc

This commit is contained in:
devmrko
2026-07-22 15:35:02 +09:00
parent 750bfbab5b
commit 3304b22bc4
42 changed files with 743 additions and 1095 deletions

View File

@@ -73,7 +73,7 @@ from ai_web_agent_console.query_contracts import (
LOG = logging.getLogger(__name__)
MCP_PROTOCOL_VERSION = "2025-11-25"
PREFERRED_TOOL = "search_hr_data"
PREFERRED_TOOL = "oracle.select_ai.smilegate_game_text2sql"
DEFAULT_QUESTION = ""
MAX_RESPONSE_BYTES = 1_000_000
MAX_CONVERSATION_MESSAGES = 8
@@ -91,15 +91,21 @@ DEFAULT_QUERY_MODEL_PROFILE = "gpt54_mini_oci"
ENV_FILE = ROOT / ".env"
MCP_SERVERS_FILE = ROOT / "config" / "mcp_servers.json"
VPD_TOKEN_PRESETS_FILE = ROOT / "config" / "vpd_token_presets.json"
DEMO_SCENARIOS_FILE = ROOT / "config" / "hmm_demo_scenarios.json"
DEMO_SCENARIOS_FILE = ROOT / "config" / "smilegate_demo_scenarios.json"
APP_PROFILE_FILE = ROOT / "config" / "app_profile.json"
CHAT_DB_FILE = ROOT / "data" / "poc4_mcp_chat.sqlite3"
DEFAULT_VPD_USER_ID = "E1001"
VPD_OPERATIONS_URL = "https://hmm-backoffice.cloud-handson.com/"
DEFAULT_VPD_USER_ID = "sg-teamlead"
VPD_OPERATIONS_URL = "https://smilegate-backoffice.cloud-handson.com/"
PORTAL_AUTHENTICATED_KEY = "poc4_portal_authenticated"
PORTAL_AUTH_USER_KEY = "poc4_portal_auth_user"
PORTAL_AUTH_PROXY_USER_HEADER = "X-HMM-Authenticated-User"
PORTAL_AUTH_PROXY_EXPIRY_HEADER = "X-HMM-Auth-Expires"
PORTAL_LOGIN_FAILURE_KEY = "poc4_portal_login_failed"
PORTAL_REMEMBER_TOKEN_PARAM = "poc4_remember"
PORTAL_REMEMBER_MAX_AGE_SECONDS = 7 * 24 * 60 * 60
AUDIT_SCHEMA = "SGMP_POC"
REFERENCE_EVIDENCE_ENABLED = (
os.environ.get("POC4_REFERENCE_EVIDENCE_ENABLED", "").strip().lower()
in {"1", "true", "yes"}
)
AUDIT_DB_ENV_FILE = Path(
os.environ.get("AI_WEB_AGENT_CONSOLE_AUDIT_DB_ENV_FILE")
or os.environ.get("POC4_AUDIT_DB_ENV_FILE")
@@ -918,6 +924,8 @@ def collect_security_evidence(
) -> Mapping[str, Any]:
"""Collect predefined, token-scoped security evidence without exposing secrets."""
if not REFERENCE_EVIDENCE_ENABLED:
return {}
kind = _security_evidence_kind(question)
if not kind or token_preset is None:
return {}
@@ -1482,6 +1490,8 @@ def collect_business_evidence(
) -> Mapping[str, Any]:
"""Collect token-validated, explicitly scoped business and catalog evidence."""
if not REFERENCE_EVIDENCE_ENABLED:
return {}
kind = _business_evidence_kind(question)
if not kind or token_preset is None:
return {}
@@ -5578,13 +5588,10 @@ def main() -> None:
)
else:
selected_token_preset = None
selected_preset_bearer = (
selected_token_preset.token if selected_token_preset is not None else ""
)
if configured_mcp_bearer or selected_preset_bearer:
# The HMM MCP gateway credential is never rendered. Each demo-user
# preset refers to its runtime env key, allowing secure profile swaps.
st.caption("MCP 인증: 선택 사용자 preset의 서버 관리 토큰 적용")
if configured_mcp_bearer:
# The Smilegate MCP gateway uses a server-side credential. UI-only
# context must never be forwarded as a second bearer token.
st.caption("MCP 인증: 서버 관리 토큰 적용")
manual_bearer_token = ""
elif selected_token_preset is not None:
manual_bearer_token = st.text_input(
@@ -5765,9 +5772,7 @@ def main() -> None:
'<div id="kb-main-tabs-anchor" style="scroll-margin-top: 0.75rem;"></div>',
unsafe_allow_html=True,
)
architecture_tab, scenario_tab, audit_tab, operations_tab = st.tabs(
["아키텍처", "시나리오", "감사로그", "보안관리"]
)
architecture_tab, scenario_tab = st.tabs(["아키텍처", "시나리오"])
with architecture_tab:
_render_architecture_tab()
@@ -5868,17 +5873,6 @@ def main() -> None:
height=0,
)
with audit_tab:
render_hmm_audit_tab(
st,
_load_hmm_audit_inventory,
_load_hmm_audit_events,
AuditLogError,
)
with operations_tab:
_render_vpd_operations_tab()
if not submitted:
return