This file applies to the o-qt-mcp-server-public repository (canonical target).
- Files:
src/tools/implementations/o_qt_qsar_tools.py,src/tools/implementations/toolbox_execution.py,src/tools/implementations/workflow_runner.py - Behavior:
run_qsar_predictionandrun_qsar_modelnow inspect the domain result from the QSAR Toolbox. If the domain status is"OutOfDomain", the result includes:"ad_status": "out_of_domain""ad_warning": true"ad_recommendation": "..."
- Rule: Do NOT remove these fields. The workflow runner surfaces AD warnings in the Markdown summary.
- Files:
src/utils/review.py,src/tools/implementations/workflow_runner.py,config/tool_permissions.default.json - Behavior: When
require_human_review=trueis passed torun_oqt_multiagent_workflow, the workflow creates up to three checkpoints:chemical_identity— after resolving the input identifier to a Toolbox recordad_assessment— when any QSAR prediction reportsad_warning=truefinal_report— before generating the PDF artifact
- If checkpoints are pending, the workflow returns
status: "review_required"withworkflow_idandreview_checkpoints. No PDF is generated. - Clients can approve/reject checkpoints via the
approve_workflow_checkpointtool, then resume by passing the sameworkflow_id(and optionallycheckpoint_approvals) to the workflow. - Rule: Do NOT auto-generate artifacts when
require_human_review=trueand checkpoints are pending. Do NOT skip thead_assessmentcheckpoint for out-of-domain predictions.
- File:
src/utils/sanitization.py,src/integrations/oqt_assistant.py - Behavior: All user-supplied identifiers and context strings are sanitized with
sanitize_for_llm()before entering the oqt_assistant LLM pipeline. - Rule: If you add new LLM-facing inputs, pipe them through
sanitize_for_llm().
- Files:
src/utils/privacy.py,src/tools/registry.py,src/api/server.py,src/utils/logging.py - Behavior:
- Audit events hash SMILES, CAS numbers, chemical names, and API keys before logging.
- The HTTP audit middleware parses query strings into dictionaries so parameter keys remain readable while values are hashed.
- The
PrivacyLogFilterscrubs SMILES/CAS patterns from free-text log messages and URL query parameters, and hashes whole-value identifiers in structured log extra fields.
- Rule: Do NOT log raw chemical identifiers or secrets. Use
scrub_dict()on params before audit emit.
- File:
src/utils/pdf_generator.py - Behavior: The fallback PDF includes:
- A prominent disclaimer on the first page
- An "Applicability Domain Warnings" section when out-of-domain predictions are present
- A "Provenance" section showing model count and AD status
- Rule: Keep the disclaimer visible. Do not remove the AD-warning block.
- File:
src/tools/implementations/workflow_runner.py,src/tools/implementations/o_qt_qsar_tools.py - Behavior:
search_typedefault is now"name"instead of"auto"to reduce silent wrong-chemical resolution. - Rule: Do not revert the default to
"auto"without explicit user confirmation logic.
- Any change to AD logic must pass
test_run_qsar_prediction_ad_warning_out_of_domain. - Any change to privacy logic must pass
tests/utils/test_privacy.py. - Any change to sanitization must pass
tests/utils/test_sanitization.py. - Any change to PDF generation must pass
test_generate_pdf_report_includes_disclaimer_and_ad_warnings.