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
32 changes: 32 additions & 0 deletions application/single_app/admin_settings_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -6328,6 +6328,38 @@
"Staged rollout flag gated behind enable_mixed_source_chat_search, with no "
"control in the server-rendered admin form."
),
# The three tabular durable-preflight switches below are always on by design.
# normalize_tabular_parity_durable_preflight_defaults() in functions_settings.py
# resets each one to True on every settings read and persists the correction, and
# _apply_tabular_parity_env_kill_switch() forces them off only while the
# SIMPLECHAT_DISABLE_TABULAR_PARITY_DURABLE_PREFLIGHT environment variable is set.

Check warning on line 6335 in application/single_app/admin_settings_fields.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.
# A switch would therefore revert in either direction. The word "shared" in the
# first key also filed it under Shared Conversation File Approvals, where it had

Check warning on line 6337 in application/single_app/admin_settings_fields.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
# nothing to do with the cards around it.
"enable_tabular_search_shared_preflight": (

Check warning on line 6339 in application/single_app/admin_settings_fields.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.
"Always on. Routes an exhaustive row-by-row request against a CSV or XLSX file, "
"made from a regular chat message (Search), through the shared tabular planner, "

Check warning on line 6341 in application/single_app/admin_settings_fields.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.
"so it can run as a durable background job over every row rather than a "
"bounded foreground answer that covers only the first few. get_settings() "

Check warning on line 6343 in application/single_app/admin_settings_fields.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.
"resets it to True on every read, so a switch would revert; the "
"SIMPLECHAT_DISABLE_TABULAR_PARITY_DURABLE_PREFLIGHT environment variable is "

Check warning on line 6345 in application/single_app/admin_settings_fields.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.
"the only way to turn it off."
),
"enable_tabular_analyze_durable_preflight": (
"Always on. The Analyze counterpart of enable_tabular_search_shared_preflight: "

Check warning on line 6349 in application/single_app/admin_settings_fields.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.
"an Analyze request against a single CSV or XLSX file goes through the same "
"shared planner and can run as a durable background job. get_settings() resets "

Check warning on line 6351 in application/single_app/admin_settings_fields.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.
"it to True on every read; the SIMPLECHAT_DISABLE_TABULAR_PARITY_DURABLE_PREFLIGHT "

Check warning on line 6352 in application/single_app/admin_settings_fields.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.
"environment variable is the only way to turn it off."
),
"enable_tabular_hierarchical_analysis": (
"Always on. Lets the durable tabular job take exhaustive per-row and per-line "
"requests, including narrative ones that ask for written answers rather than a "
"CSV, JSON or XML export; without it they fall back to a bounded foreground "
"answer. get_settings() resets it to True on every read; the "

Check warning on line 6359 in application/single_app/admin_settings_fields.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.
"SIMPLECHAT_DISABLE_TABULAR_PARITY_DURABLE_PREFLIGHT environment variable is the "
"only way to turn it off."
),
}


Expand Down
2 changes: 1 addition & 1 deletion application/single_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
EXECUTOR_TYPE = 'thread'
EXECUTOR_MAX_WORKERS = 30
SESSION_TYPE = 'filesystem'
VERSION = "0.261.260"
VERSION = "0.261.261"
IS_DEVELOPMENT = is_development_env_enabled()

# Opt-out for deployments where App Service Easy Auth is active but the platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ All Phase 8 rollout controls are backend-only and are removed by `sanitize_setti

> **Update (0.250.186):** `tabular_request_planner_mode` now defaults to `active` and both `enable_tabular_search_shared_preflight` and `enable_tabular_analyze_durable_preflight` default to `True`. Bounded foreground synthesis for exhaustive row-by-row tabular requests is no longer the default behavior. There is intentionally no admin UI toggle for this; use the `SIMPLECHAT_DISABLE_TABULAR_PARITY_DURABLE_PREFLIGHT` environment variable for emergency rollback (see below).

> **Update (0.261.261):** V2 Admin Settings had been drawing switches for these flags through its `enable_*` fallback scan, and those switches reverted on the next settings read. They are now listed in `SUPPRESSED_CAPABILITY_KEYS`, so neither admin interface offers a toggle. See [V2 Admin Tabular Preflight Switch Fix](../fixes/V2_ADMIN_TABULAR_PREFLIGHT_SWITCH_FIX.md).

## Usage Instructions

How to enable/configure:
Expand Down
8 changes: 7 additions & 1 deletion docs/explanation/features/V2_ADMIN_CHAT_SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,15 @@ claims there is something to edit.
| `enable_enhanced_citations_mount` | No control in either interface; forced off unless Enhanced Citations is on |
| `enable_mixed_source_chat_search` | Staged rollout flag with no administrator control |
| `enable_mixed_source_conversation_continuity` | Staged rollout flag gated behind the above |
| `enable_tabular_search_shared_preflight` | Always on; `get_settings()` resets it to `True` on every read, and `SIMPLECHAT_DISABLE_TABULAR_PARITY_DURABLE_PREFLIGHT` is the only off switch |
| `enable_tabular_analyze_durable_preflight` | Always on, forced the same way |
| `enable_tabular_hierarchical_analysis` | Always on, forced the same way |

The list is served on the settings GET as `suppressed_capabilities` and honoured
by `buildCapabilityIndex`.
by `buildCapabilityIndex`. Every `enable_*` key in
`TABULAR_PARITY_DURABLE_PREFLIGHT_ACTIVE_DEFAULTS` must be suppressed; see
[V2 Admin Tabular Preflight Switch Fix](../fixes/V2_ADMIN_TABULAR_PREFLIGHT_SWITCH_FIX.md)
(0.261.261).

### Enhanced Citations storage test

Expand Down
105 changes: 105 additions & 0 deletions docs/explanation/fixes/V2_ADMIN_TABULAR_PREFLIGHT_SWITCH_FIX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# V2 Admin Tabular Preflight Switch Fix

## Issue

V2 Admin Settings showed a switch called **Tabular search shared preflight**
(`enable_tabular_search_shared_preflight`) under Workspaces › Files & Sharing ›
Shared Conversation File Approvals. It had no description and nothing to do with file
approvals. Changing it had no lasting effect: a switch turned off came back on after the
next page load.

Two related flags, `enable_tabular_analyze_durable_preflight` and
`enable_tabular_hierarchical_analysis`, had the same problem. They appeared as raw keys
under **Other capabilities**.

## What these flags do

All three control how SimpleChat handles an exhaustive request against a CSV or XLSX
file, such as "for every row, answer these questions" or "give me a CSV with one line per
row".

| Flag | Effect while on |
| --- | --- |
| `enable_tabular_search_shared_preflight` | A regular chat message (Search) goes through the shared tabular planner. The planner can run the request as a durable background job over every row. |
| `enable_tabular_analyze_durable_preflight` | The Analyze path does the same for a request against a single tabular file. |
| `enable_tabular_hierarchical_analysis` | The durable job accepts exhaustive per-row and per-line requests, including ones that ask for written answers rather than a file export. |

With any of them off, those requests fall back to the older foreground path. That path
answers the first rows that fit in one model turn and then truncates, or keeps retrying
without finishing. This was the customer-reported failure the tabular parity work fixed.
The only reason to turn them off is an incident rollback, which the environment variable
below handles, so they are always on.

## Root cause

The V2 admin page draws a switch for every `enable_*` boolean in the settings document
that `admin_settings_fields.py` does not declare. It places each one under the navigation
section whose id shares the most words with the key (`buildCapabilityIndex` in
`AdminSettingsPage.tsx`). The only word `enable_tabular_search_shared_preflight` shares
with any section id is "shared", in `shared-conversation-file-approvals-section`. That is
where it was drawn.

None of the three flags can be edited:

- `normalize_tabular_parity_durable_preflight_defaults()` in `functions_settings.py` sets
each one back to `True` on every `get_settings()` read and saves the correction. It
exists because older deployments stored these flags as `False` before their defaults
were raised. See [Tabular Parity Stale Settings Migration Fix](TABULAR_PARITY_STALE_SETTINGS_MIGRATION_FIX.md).
- `_apply_tabular_parity_env_kill_switch()` forces them to `False` while the
`SIMPLECHAT_DISABLE_TABULAR_PARITY_DURABLE_PREFLIGHT` environment variable is set. This is
the supported emergency rollback.

A switch therefore reverted in either direction. The classic admin page has never had a
control for these flags, and the rollout documentation says there is intentionally no
admin toggle.

## Fixed in version: **0.261.261**

The application version is maintained in `application/single_app/config.py`.

## Technical details

### Files modified

| File | Change |
| --- | --- |
| `application/single_app/admin_settings_fields.py` | Added the three flags to `SUPPRESSED_CAPABILITY_KEYS`, each with the reason it is not an administrator setting. |
| `functional_tests/test_v2_admin_capability_placement.py` | Expects the three suppressions, adds a check that covers every forced flag, and adds Workspaces to the groups that must receive no guessed switches. |
| `application/single_app/config.py` | Version bump. |

### Code changes

- The settings GET already sends `SUPPRESSED_CAPABILITY_KEYS` as `suppressed_capabilities`,
and `buildCapabilityIndex` skips those keys. Listing the three flags removes their switches
and needs no frontend change.
- Defaults and runtime behavior are unchanged. The flags stay `True`, and the environment
variable still turns all of them off.

### Impact

- Shared Conversation File Approvals now shows only its own setting.
- **Other capabilities** no longer lists the two sibling flags.
- Administrators can no longer flip a switch that appears to save but has no lasting effect.

## Validation

`functional_tests/test_v2_admin_capability_placement.py` passes 8/8. To confirm the guards
catch the regression, the suppression for `enable_tabular_search_shared_preflight` was
removed in memory, and three checks then failed:

- `test_described_groups_receive_no_guessed_capabilities` reported the key filed under
Workspaces › Files & Sharing › `shared-conversation-file-approvals-section`. Workspaces
is now one of the groups that must receive no guessed switches.
- `test_forced_tabular_parity_flags_are_suppressed` reads
`TABULAR_PARITY_DURABLE_PREFLIGHT_ACTIVE_DEFAULTS` from `functions_settings.py` and
requires every `enable_*` key in it to be suppressed with a reason. A flag added to that
map later is covered without editing the test.
- `test_non_editable_capabilities_are_suppressed_not_declared` reported the missing
suppression.

Before: an unlabelled switch under Shared Conversation File Approvals and two raw keys
under Other capabilities, all of which reverted after saving. After: no switch for any of
the three, and all three stay on.

Related: [V2 Admin Chat Settings](../features/V2_ADMIN_CHAT_SETTINGS.md),
[Tabular Analyze Search Parity Rollout](../features/TABULAR_ANALYZE_SEARCH_PARITY_ROLLOUT.md).
10 changes: 10 additions & 0 deletions docs/explanation/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

For feature-focused and fix-focused drill-downs by version, see [Features by Version](https://github.com/microsoft/simplechat/tree/main/docs/explanation/features) and [Fixes by Version](https://github.com/microsoft/simplechat/tree/main/docs/explanation/fixes).

### **(v0.261.261)**

#### Bug Fixes

* **Always-On Tabular Switches Removed From V2 Admin Settings**
* V2 Admin Settings no longer shows an unlabelled **Tabular search shared preflight** switch under Workspaces › Files & Sharing › Shared Conversation File Approvals. It landed there only because its key contains the word "shared". It also no longer shows `enable_tabular_analyze_durable_preflight` or `enable_tabular_hierarchical_analysis` under Other capabilities.
* All three flags send exhaustive row-by-row requests against CSV and XLSX files to a durable background job that covers every row, instead of a foreground answer that truncates. They are always on: settings loading resets them to on every time, so the switches reverted after every save. Behavior is unchanged, and the `SIMPLECHAT_DISABLE_TABULAR_PARITY_DURABLE_PREFLIGHT` environment variable is still the emergency off switch.
* The capability placement test now fails if any flag that settings loading resets is drawn as a switch, or if a guessed switch lands in the Workspaces group.
* (Ref: `admin_settings_fields.SUPPRESSED_CAPABILITY_KEYS`, `TABULAR_PARITY_DURABLE_PREFLIGHT_ACTIVE_DEFAULTS`, `test_v2_admin_capability_placement.py`, [V2 Admin Tabular Preflight Switch Fix](fixes/V2_ADMIN_TABULAR_PREFLIGHT_SWITCH_FIX.md))

### **(v0.261.260)**

#### Bug Fixes
Expand Down
Loading
Loading