Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/single_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
EXECUTOR_TYPE = 'thread'
EXECUTOR_MAX_WORKERS = 30
SESSION_TYPE = 'filesystem'
VERSION = "0.250.196"
VERSION = "0.250.200"
IS_DEVELOPMENT = is_development_env_enabled()

SESSION_COOKIE_SAMESITE = os.getenv('SESSION_COOKIE_SAMESITE', 'Lax')
Expand Down
5 changes: 5 additions & 0 deletions application/single_app/functions_document_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,14 +452,19 @@ def _prompt_requests_per_source_output(analysis_prompt):
source_output_markers = (
'one object per comment',
'one row per comment',
'one line per comment',
'one object per submission',
'one row per submission',
'one line per submission',
'one object per document',
'one row per document',
'one line per document',
'one object per source',
'one row per source',
'one line per source',
'each object must contain',
'each row must contain',
'each line must contain',
'exactly these fields',
'treat each standalone document as one comment',
)
Expand Down
46 changes: 45 additions & 1 deletion application/single_app/functions_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,51 @@
settings_payload['tabular_request_planner_mode'] = 'off'
settings_payload['enable_tabular_search_shared_preflight'] = False
settings_payload['enable_tabular_analyze_durable_preflight'] = False
settings_payload['enable_tabular_hierarchical_analysis'] = False
return settings_payload


# Backend-only tabular durable-preflight parity flags that ship "active" by default with no
# admin UI toggle. The only sanctioned way to disable them is the

Check warning on line 1035 in application/single_app/functions_settings.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains security control, sanitization, or audit marker. Recommendation%3A Confirm the change does not weaken auth, CSRF, CSP, XSS defenses, settings sanitization, redaction, audit logging, or tests.
# SIMPLECHAT_DISABLE_TABULAR_PARITY_DURABLE_PREFLIGHT environment kill switch (applied later,

Check warning on line 1036 in application/single_app/functions_settings.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains security control, sanitization, or audit marker. Recommendation%3A Confirm the change does not weaken auth, CSRF, CSP, XSS defenses, settings sanitization, redaction, audit logging, or tests.
# dynamically, in _apply_tabular_parity_env_kill_switch()) -- never a persisted settings value.
TABULAR_PARITY_DURABLE_PREFLIGHT_ACTIVE_DEFAULTS = {
'tabular_request_planner_mode': 'active',
'enable_tabular_search_shared_preflight': True,

Check warning on line 1040 in application/single_app/functions_settings.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains secret or sensitive data source marker. Recommendation%3A Pair this source with any nearby network, logging, serialization, or process execution sink before approving.
'enable_tabular_analyze_durable_preflight': True,
'enable_tabular_hierarchical_analysis': True,
}


def normalize_tabular_parity_durable_preflight_defaults(settings):
"""Upgrade stale persisted tabular durable-preflight parity flags to their active defaults.

deep_merge_dicts() only fills in keys that are *missing* from a persisted settings
document; it never overwrites a key that already exists. These four flags were
originally introduced with off/False defaults, so the first settings load in any
existing deployment permanently persisted the old off/False values to Cosmos DB.

Check warning on line 1052 in application/single_app/functions_settings.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains secret or sensitive data source marker. Recommendation%3A Pair this source with any nearby network, logging, serialization, or process execution sink before approving.
Later raising the code-level default to active/True (see
TABULAR_PARITY_DURABLE_PREFLIGHT_ACTIVE_DEFAULTS) therefore had no effect for any
deployment whose settings document already had these keys -- every tabular Analyze/
Search request kept silently falling back to the legacy bounded foreground path.

Check warning on line 1056 in application/single_app/functions_settings.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains secret or sensitive data source marker. Recommendation%3A Pair this source with any nearby network, logging, serialization, or process execution sink before approving.

Because these settings have no admin UI, any stored value that differs from the
active default can only be stale drift (never an intentional admin choice), so it is
safe to unconditionally correct it here on every load. This runs independently of the
env kill switch, which is still applied afterwards in _apply_tabular_parity_env_kill_switch()
and continues to work exactly as before.
"""
if not isinstance(settings, dict):
return False

changed = False
for key, active_value in TABULAR_PARITY_DURABLE_PREFLIGHT_ACTIVE_DEFAULTS.items():
if settings.get(key) != active_value:
settings[key] = active_value
changed = True
return changed


def get_settings(use_cosmos=False, include_source=False):
import secrets
default_settings = {
Expand All @@ -1054,7 +1096,7 @@
'enable_tabular_processing_plugin': False,
'enable_analysis_deliverable_contract_telemetry': False,
'analysis_deliverable_contract_mode': 'off',
'enable_tabular_hierarchical_analysis': False,
'enable_tabular_hierarchical_analysis': True,
'enable_tabular_parity_contract_telemetry': False,
'tabular_parity_contract_mode': 'off',
'tabular_hierarchical_analysis_reduce_fan_in': 25,
Expand Down Expand Up @@ -1745,6 +1787,7 @@
inbound_mcp_settings_updated = normalize_inbound_mcp_settings(merged)
public_workspace_display_settings_updated = normalize_public_workspace_display_settings(merged)
key_vault_reminder_settings_updated = normalize_key_vault_reminder_settings(merged)
tabular_parity_durable_preflight_settings_updated = normalize_tabular_parity_durable_preflight_defaults(merged)

merged['enable_tabular_processing_plugin'] = is_tabular_processing_enabled(merged)

Expand All @@ -1759,6 +1802,7 @@
or inbound_mcp_settings_updated
or public_workspace_display_settings_updated
or key_vault_reminder_settings_updated
or tabular_parity_durable_preflight_settings_updated
):
cosmos_settings_container.upsert_item(merged)
_refresh_app_settings_cache_after_write(merged, context="merge_upsert")
Expand Down
Loading
Loading