Repository navigation
Description
Issue
Workspace documents uploaded through a chat can carry a conversation_id. The shared ordered-chunk payload incorrectly prefers this conversation ID over the document's authorized workspace scope ID. Downstream Analyze/Compare consumers consequently receive an inconsistent (scope, scope_id) identity.
The failure was observed in FED-04 on the React V2 application, then reproduced offline with the real shared retrieval, document analysis, comparison, and content-screening code. This is a shared product-source contract defect, not a FED-04 selector or model-specific problem.
Steps to Reproduce
- Independently upload two narrative policy revisions through a chat backed by a group workspace.
- Request a document comparison, review the
document_compareand dependent composition steps, and approve once. - Both per-document analyses complete, but the comparison source guard rejects the malformed group identity before the pairwise model call.
- Observe the comparison step as Failed and dependent composition as Skipped.
The reported scenario requested thresholds 125000 → 150000, review days 10 → 7, unchanged owner, and exact markers/citations for both revisions, without agents, actions, web, workflows, or file creation.
Expected Behavior
- Workspace scope is determined by the authorized source context: personal owner, group, or public workspace. A conversation association remains separate metadata.
- Only actual chat-scoped sources use a conversation ID as their scope ID.
- Authorized comparison and downstream composition complete with both revisions grounded and cited.
- Current authorization, screening, revision, completeness, and no-unrequested-file checks remain enforced.
Actual Behavior
In application/single_app/functions_search_service.py, get_document_chunks_payload() builds scope_id with a fallback chain that puts context/document conversation_id before public_workspace_id, group_id, or owner identity.
functions_document_analysis.py carries that scope into its raw window and document-analysis items. Its coverage entries also contain correct provenance, so their checks can pass. functions_document_comparison.py subsequently traverses the full source results using guard_model_callable; the malformed items then fail authorization in content_screening/access.py.
The explicit Analyze result path also compares this payload identity against its authorized source manifest in functions_document_analysis_results.py::build_analysis_source, so a shared boundary fix is required rather than bypassing comparison's guard.
Impact
- Offline reproduction: a group document without chat association compares successfully; the otherwise identical chat-linked group document fails with
PermissionErrorafter both summary model calls. - Chat-linked public workspace documents reproduce the same failure.
- Chat-linked personal documents also emit the wrong scope metadata, even when the legacy comparison's owner check happens to allow execution.
- Callers of the shared retrieval service, including orchestration and workflow document processing, can inherit this inconsistent identity.
Notes
Live evidence
- FED-04 attempt
repair2-20261017; failure at 2026-10-17 21:54:44 UTC. - Application telemetry reports version 0.261.344; investigation checkout is 0.261.346 and still contains the defective boundary.
- Both uploads completed, and both document analyses processed one window with zero failed windows.
- Application Insights exception stack:
run_document_compare→run_document_comparison→_run_internal_document_comparison→ guarded model callable →assert_evidence_available→_read_authorized_document→_authorize_document→PermissionError. - Executor reports
capability_id=document_compare,failure_code=result_unavailable; the run later recordscontext_unavailable. The generic retained-result message does not identify the source-scope mismatch. - The UI's Failed/Skipped states match backend telemetry; increasing the UI timeout or relaxing acceptance would hide the defect.
Validation so far
A read-only, socket/DNS-blocked probe using the existing test_support.document_analysis.document_analysis_runtime and real comparison code produced:
| Source | Conversation association | Returned scope ID | Outcome |
|---|---|---|---|
| Group | Absent | Group ID | Complete |
| Group | Present | Conversation ID | PermissionError before comparison model call |
| Public | Present | Conversation ID | PermissionError before comparison model call |
| Personal | Present | Conversation ID | Complete, but malformed scope identity |
Existing-test command, with application and functional test directories on PYTHONPATH:
python -m pytest -p test_support.cosmos_network_guard -p no:cacheprovider .\functional_tests\test_orchestration_internal_analysis.py -k comparison -q
Result: 7 passed, 56 deselected, 1 setup error. The setup error is a local dependency incompatibility: OpenSSL.crypto raises AttributeError: module 'lib' has no attribute 'GEN_EMAIL' during the Semantic Kernel import chain. It is not evidence that the product fix is validated.
Agreed scope and acceptance
- Fix source-scope construction at the shared owner and cover personal, group, public, and actual chat sources, including chat-linked workspace documents and approved shared-group access paths.
- Add real-boundary regression coverage for Analyze, Compare, and dependency execution; do not replace authorization checks with permissive mocks.
- Preserve denied/changed/held source behavior and no-file output policy.
- Leave UI-test qualifications, timeouts, retry behavior, and model/provider selection unchanged.
- Include fix documentation and an application patch-version increment; no deployment or production mutation is part of this investigation.
Triage: P1, size M, assigned to paullizer. Related orchestration work: #1509. Duplicate searches found similar generic error reports but not this source-scope defect.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsPending Evaluation
Activity