[Test failure] Recommendations helper sends doc_id; docproc now reads docId, so the filter is ignored
The test is wrong confidence medium · medium priority · api-tests-master, last seen in build 597
The verdict
- Fix is in
- the automation suite (e2e): the test is wrong
- Issue
- ENG-8846 · Completed
- Owner
- [email protected] (last changed test_document_tmf_promotion.py (b1537332f); the test agent opens the pull request once this is in Ready for Development)
- Filed in
- Backlog, Test Agent Automation
- History when filed
- new, this error since build 597
- Suspect commit
- 9b80cb7b6 Use camelCase for API query params and JSON fields across Go and Pyth… (arzatskis)
- Branches
- fails on master only: production is unaffected (api-tests-production build 620). Fix it before master is released to production.
The test gets a Version Link that belongs to another document. Its documentName is IB_source_v2.0.pdf, which is the source file in test_02, not the IB_upl_source_v2.0.pdf this test uploads.
Cause: e2e/automation/models/recommendations.py:14 sends the query params `doc_id` and `include_support_ignored`. In data-science/docproc/src/api/recommendations_router.py:599 the param is now `alias="docId"`, and line 611 is `alias="includeSupportIgnored"`. Blame on line 599 gives 9b80cb7b6 (camelCase API params, Nov 12), which landed after the last pass (build 593).
With `doc_id` ignored, the list endpoint returns recommendations for every visible document. wait_for_version_link (doc_helper.py:356-370) takes the first Version Link in that list, so it can return another test's link.
I did not check why builds 594-596 are missing from the history, or whether that commit also edited e2e. Both could explain why this only failed now.
Other tests that call Recommendations.get_by_document_id probably have the same problem. The Document_Enhance and action-count failures in the console are different errors.
Proposed fix
In e2e/automation/models/recommendations.py get_by_document_id, change the params to {"docId": doc_id, "limit": limit, "includeSupportIgnored": include_support_ignored}. In wait_for_version_link, also require item.get("docId") == doc_id so a stray link cannot satisfy the wait. Check other callers of the recommendations list for snake_case params.
History of this root cause
- filed ENG-8846 · build 597 8d ago
The test is wrong, confidence medium; 1 test; to [email protected] in Backlog
- branches ENG-8846 7d ago
Tests 1
Oldest to newest, up to 30 runs. Green passed, red failed with this error, amber failed with another error. Skipped and collapsed runs are left out. Newest build: 599.
| Test | History | Newest run | Reading |
|---|---|---|---|
| test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link DocumentTMFPromotion |
did not run |
How the agent decided
- Models
- claude-sonnet-5-5 ($0.42, 14 lookups)
- Settled by
- the investigating model
- Cost
- $0.42
What it looked up (14, in order)
1. search_code repo=main, text=def wait_for_version_link · 121 chars back
e2e/automation/utils/helpers/doc_helper.py
356: def wait_for_version_link(headers, doc_id, max_retries=15, interval=2):
2. search_code repo=main, text=IB_source_v2.0.pdf · 173 chars back
e2e/automation/tests/docsvc/test_document_tmf_promotion.py
224: source_id = _stage_and_categorize_doc(doc_api, study_id, "IB_source_v2.0.pdf", artifact_id, subartifact_id)
3. read_file repo=main, path=e2e/automation/utils/helpers/doc_helper.py, start_line=300, end_line=400 · 3989 chars back
e2e/automation/utils/helpers/doc_helper.py (370 lines), lines 300-370:
300 folder_path: Absolute or relative path to the folder
301 recursive: Walk sub-folders too. Pass False to read one level — a reply that must withhold
302 the documents sitting in a nested folder (e.g. an approval letter sent later)
303 exclude_dir_names: Sub-folder names to skip while walking
304 default_content_type: MIME type for extensions not in CONTENT_TYPE_BY_EXTENSION
305
306 Returns:
307 List of tuples (filename, file_content, content_type), sorted by path so attachment order
308 is stable across runs
309 """
310 attachment_files = []
311
312 if not os.path.exists(folder_path):
313 logger.warning(f"Folder does not exist: {folder_path}")
314 return attachment_files
315
316 for dir_path, dir_names, file_names in os.walk(folder_path):
317 if recursive:
318 dir_names[:] = sorted(
319 name for name in dir_names if not name.startswith(".") and name not in exclude_dir_names
320 )
321 else:
322 dir_names[:] = []
323 for filename in sorted(file_names):
324 if filename.startswith("."):
325 logger.info(f"Skipping hidden/system file: {filename}")
326 continue
327 file_path = os.path.join(dir_path, filename)
328 extension = os.path.splitext(filename)[1].lower()
32
… (2489 more characters not kept)
4. read_file repo=main, path=e2e/automation/tests/docsvc/test_document_tmf_promotion.py, start_line=195, end_line=260 · 4418 chars back
e2e/automation/tests/docsvc/test_document_tmf_promotion.py (525 lines), lines 195-260:
195 logger.info(f"✓ Deleted test document: {document_id}")
196 else:
197 logger.warning(f"Failed to delete document {document_id}: {delete_response.text}")
198
199 logger.info("=== ✓ Test Complete: Document successfully promoted to TMF ===")
200
201 def test_02_promote_staging_document_as_new_version_of_tmf_document(self, data):
202 """Promote-as-new-version driven by a Version Link: a second Staging doc is linked to an
203 existing TMF doc during staging, and a plain promote stacks it onto that link's target.
204
205 Asserts: the promote call needs no target of its own; the target gains a new major version
206 that becomes primary and links back to the source; the source is archived (hidden from
207 listing) yet id-accessible and points to the target via promotedTo.
208 """
209 test_headers = data["cro_test_headers"]
210 study_id = data["study"]["tildaid"]
211 doc_api = Document(test_headers)
212 rec_api = Recommendations(test_headers)
213
214 tmf_folders = get_tmf_folders_for_study(test_headers, study_id)
215 ib_location = get_tmf_subartifact_for_deliverable(tmf_folders, "Investigator's Brochure")
216 artifact_id, subartifact_id = ib_location["folderId"], ib_location["subArtifactId"]
217
218 logger.info("Step 1: Creating a TMF tar
… (2918 more characters not kept)
5. search_code repo=main, text=def get_by_document_id · 126 chars back
e2e/automation/models/recommendations.py
12: def get_by_document_id(self, doc_id, limit=100, include_support_ignored=False):
6. commit_diff repo=main, sha=3103c65d7 · 6579 chars back
3103c65d7 2026-11-13T12:53 vishal23karedla: Retire GET /api/documents/v2/{documentID} in favor of POST .../view (#17423)
7 files changed: data-science/docproc/src/clients/docsvc_client.py, docsvc/pkg/handlers/documents.go, docsvc/pkg/models/document/model.go, docsvc/routes/routes.go, e2e/automation/models/document.py, e2e/automation/tests/docsvc/test_upload_document.py, tctl/doc/document.go
--- data-science/docproc/src/clients/docsvc_client.py
@@ -105,7 +105,7 @@ async def bulk_create_documents(
async def get_document(
doc_id: str, org_alias: str, timeout_s: float = 30.0
) -> Optional[Dict[str, Any]]:
- """GET /api/documents/v2/{id}. The read also reconciles Upload Pending -> Uploaded.
+ """POST /api/documents/v2/{id}/view. The read also reconciles Upload Pending -> Uploaded.
The endpoint takes its detail spec from the request body; without
"versions" the pending-upload reconciliation fails server-side, so the
@@ -117,8 +117,8 @@ async def get_document(
base_url, headers = ctx
details = {"details": ["versions", "signedWriteUrl", "org"]}
try:
- response = await get_async_client().request(
- "GET", f"{base_url}/api/documents/v2/{doc_id}", headers=headers, json=details, timeout=timeout_s
+ response = await get_async_client().post(
+ f"{base_url}/api/documents/v2/{doc_id}/view", headers=headers, json=details, timeout=timeout_s
)
response.raise_for_status()
return response.json(
… (5079 more characters not kept)
7. read_file repo=main, path=e2e/automation/models/recommendations.py, start_line=1, end_line=60 · 1188 chars back
e2e/automation/models/recommendations.py (26 lines), lines 1-26:
1 import logging as logger
2
3 from .base import RequestsBase
4
5
6 class Recommendations(RequestsBase):
7 def __init__(self, headers):
8 self.relative_url = "/api/v1/docproc/recommendations"
9 super().__init__(headers)
10
11 @RequestsBase.retry_request
12 def get_by_document_id(self, doc_id, limit=100, include_support_ignored=False):
13 """GET a document's recommendations (raw response); `include_support_ignored` adds support-ignored ones."""
14 params = {"doc_id": doc_id, "limit": limit, "include_support_ignored": include_support_ignored}
15
16 logger.info(f"Getting recommendations for document: {doc_id}")
17 response = self.get(params=params)
18
19 if response.status_code == 200:
20 data = response.json()
21 total_recommendations = data.get("totalCount", 0)
22 logger.info(f"Retrieved {total_recommendations} recommendations for document {doc_id}")
23 else:
24 logger.error(f"Failed to get recommendations: {response.status_code} - {response.text}")
25
26 return response
8. search_code repo=main, text=doc_id, path_prefix=data-science/docproc/src/routes · 30 chars back
no match on the default branch
9. commits repo=main, path=data-science/docproc, since=2026-11-12T00:00:00Z · 1209 chars back
f56eb0825 2026-11-14T20:22 akashanandan-tilda: docproc: scope agent clears a siteId that is not a configured study site (ENG-8726) (#17457)
13cb7ca06 2026-11-14T19:31 akashanandan-tilda: docproc: site lookup keeps staff matches, retries failed site-information extraction (#17453)
e6f61dedd 2026-11-14T19:31 akashanandan-tilda: Hotfix cbr allow sentinel date (#17454)
fda66e1f1 2026-11-13T18:06 aaburaed: fix(docproc): protocol guard ignores a date read as 300CT2026 and a value beside stacked labels (ENG-8762) (#17437)
3103c65d7 2026-11-13T12:53 vishal23karedla: Retire GET /api/documents/v2/{documentID} in favor of POST .../view (#17423)
376c3c9ac 2026-11-12T21:06 aaburaed: fix(docproc): unconfigured-site finding is recognised by the site guard; site list sorted (ENG-8727) (#17407)
55faeadfd 2026-11-12T18:56 aaburaed: feat(docsvc,docproc): split documents carry the original's audit log, who split it and who submitted it (ENG-8256) (#17405)
0f5f3f035 2026-11-12T17:54 aaburaed: fix(docproc): QC flags a document from a site not configured for the study (ENG-8727) (#17400)
9b80cb7b6 2026-11-12T06:30 arzatskis: Use camelCase for API query params and JSON fields across Go and Python services (#17334)
10. commit_diff repo=main, sha=9b80cb7b6, path=data-science/docproc · 7827 chars back
9b80cb7b6 2026-11-12T06:30 arzatskis: Use camelCase for API query params and JSON fields across Go and Python services (#17334)
109 files changed: AGENTS.md, authz/pkg/handlers/members.go, authz/pkg/handlers/staff.go, authz/pkg/health/credentialcheck_test.go, authz/pkg/health/screeningclient.go, common/params/params.go, data-science/authzsvc/authz_svc/app.py, data-science/authzsvc/pyproject.toml, data-science/authzsvc/uv.lock, data-science/chat-agent/Dockerfile, data-science/chat-agent/Dockerfile.evals, data-science/chat-agent/pyproject.toml, data-science/chat-agent/src/artifacts/api_models.py, data-science/chat-agent/src/artifacts/blocks.py, data-science/chat-agent/src/artifacts/models.py, data-science/chat-agent/src/artifacts/route.py, data-science/chat-agent/src/auth/route.py, data-science/chat-agent/src/chat_agent/api_models.py, data-science/chat-agent/src/import_jobs/api_models.py, data-science/chat-agent/src/memory/api_models.py, data-science/chat-agent/src/memory/dependencies.py, data-science/chat-agent/src/memory/route.py, data-science/chat-agent/src/projects/models.py, data-science/chat-agent/src/runs/api_models.py, data-science/chat-agent/src/threads/route.py …
--- data-science/docproc/Dockerfile
@@ -61,7 +61,8 @@ RUN --mount=type=cache,id=uv-docproc,target=/root/.cache/uv,sharing=locked \
--mount=from=ghcr.io/astral-sh/uv:0.12.14,source=/uv,target=/bin/uv \
uv sync -q --frozen --no-dev --no-editable --no-install-project \
--no-install-package tilda-
… (6327 more characters not kept)
11. search_code repo=main, text=include_support_ignored · 1394 chars back
e2e/automation/models/recommendations.py
12: def get_by_document_id(self, doc_id, limit=100, include_support_ignored=False):
13: """GET a document's recommendations (raw response); `include_support_ignored` adds support-ignored ones."""
14: params = {"doc_id": doc_id, "limit": limit, "include_support_ignored": include_support_ignored}
data-science/chat-agent/src/chat_agent/tools/shared/recommendations_list.py
71: ", and findings support silenced are excluded (include_support_ignored=true adds them)"
100: include_support_ignored: bool = False,
174: - include_support_ignored (bool, default=False): include findings
208: include_support_ignored=include_support_ignored,
data-science/docproc/src/api/router.py
162: include_support_ignored=True,
data-science/virtual_assistant/src/api/recommendation_updater/bulk.py
41: include_support_ignored=True,
145: include_support_ignored=True,
data-science/chat-agent/src/infra/backend/client.py
2342: include_support_ignored: bool | None = None,
2357: include_support_ignored=include_support_ignored,
data-science/docproc/src/api/recommendations_router.py
611: include_support_ignored: bool = Query(False, description="Include recommendations ignored by support (default: False)", alias="includeSupportIgnored"),
690: include_support_ignored=include_support_ignored,
727: include_support_ignored=include_support_ignored,
12. read_file repo=main, path=data-science/docproc/src/api/recommendations_router.py, start_line=590, end_line=740 · 9639 chars back
data-science/docproc/src/api/recommendations_router.py (2380 lines), lines 590-740:
590 raise HTTPException(status_code=500, detail=str(e))
591
592
593 # ============================================================================
594 # Recommendation CRUD Endpoints
595 # ============================================================================
596
597 @recommendations_router.get("", response_model=PaginatedRecommendationResponse, status_code=200, openapi_extra={"x-tilda-action": "read"}, summary="List recommendations with pagination, sorting, and search", responses=er
598 async def list_recommendations(
599 doc_id: Optional[str] = Query(None, description="Document ID to filter recommendations", alias="docId"),
600 study_id: Optional[str] = Query(None, description="Study ID to filter recommendations", alias="studyId"),
601 site_id: Optional[str] = Query(None, description="Site ID to filter recommendations", alias="siteId"),
602 status: Optional[List[Literal["pending", "confirmed", "ignored", "resolved"]]] = Query(None, description="Filter by recommendation status. Multiple values accepted (repeat `status=` or pass a list). Default when omit
603 category: Optional[Literal["Quality Control", "Document Naming", "TMF Artifact", "Sub Artifact", "Document Metadata", "PHI Issues", "Document Version", "Document Scope", "Document Format", "Document Summary", "Docume
604 created_after: Optional[datetime] = Query(None, description="Only include reco
… (8139 more characters not kept)
13. commits repo=main, path=e2e/automation/models/recommendations.py, since=2026-11-01T00:00:00Z · 38 chars back
no commits to that path in that window
14. blame repo=main, path=data-science/docproc/src/api/recommendations_router.py, start_line=599, end_line=599 · 123 chars back
lines 599-599: 9b80cb7b6 2026-11-12T06:30 arzatskis: Use camelCase for API query params and JSON fields across Go and Pyth…
What it was shown (build 597, 33.8 KB)
The run
{
"job": "api-tests-master",
"build": 597,
"kind": "api-tests",
"result": "SUCCESS",
"started": "2026-11-15T00:26:03Z",
"tests": 1024,
"failed": 40,
"test_commit": "03f9c2d6b",
"cluster_prepared": {
"mode": "prepare",
"result": "ready",
"product_commit": "f56eb0825"
}
}
services
[
"docsvc",
"execsvc",
"patientsvc",
"schedsvc",
"enrollsvc",
"studiosvc",
"finsvc",
"notifsvc",
"dslsvc",
"authz",
"dashQL",
"dashRsvc",
"regsvc",
"advpsvc",
"workplansvc",
"datasvc",
"payoutsvc",
"tusker",
"authsvc",
"eventsvc",
"ehrsvc",
"docproc",
"studioai",
"sense"
]
The cluster during the run
{
"findings_opened_around_the_run": [],
"long_standing_findings_left_out": 7,
"pods_in_trouble_during_the_run": [
{
"workload": "tilda/chat-agent",
"probe": 1.0,
"first_minutes_after_run_start": 8
}
],
"deploys_during_the_run": [
{
"app": "execsvc",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "studioaisvc",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "docproc",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "docsvc",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "exportsvc",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "tusker",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "dashrsvc",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "dashql",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "notifsvc",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "chat-agent",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "virtual-assistant",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
},
{
"app": "onboardingsvc",
"minutes_after_run_start": 33,
"image": "",
"by": "automated"
}
]
}
The group
{
"tests": 1,
"suite": "DocumentTMFPromotion",
"members": [
{
"test": "automation/tests/docsvc/test_document_tmf_promotion.py::TestDocumentTMFPromotion::test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link",
"pattern": "new",
"meaning": "failed 1 run after passing the 29 before",
"newest_first": "F P P P P P P P P P P P P P P P P P P P P P P P P P P P P P",
"failing_in_a_row": 1,
"this_error_in_a_row": 1,
"this_error_since_build": 597,
"build_before_this_error": 593,
"failing_since_build": 597,
"last_passed_build": 593
}
]
}
The failure
{
"test": "automation/tests/docsvc/test_document_tmf_promotion.py::TestDocumentTMFPromotion::test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link",
"status": "failed",
"message": "AssertionError: link should name the target: {'tildaid': '79ae9bc1-0b71-4383-94a1-2e679cd51732', 'recId': 'NZ0174DD', 'docId': '526b44e1-4833-42cd-be1d-ddb3e36a2635', 'userAction': 'Confirm', 'status': 'confirmed', 'category': 'Version Link', 'data': '', 'dataFormatted': None, 'suggestions': None, 'explanation': None, 'comment': None, 'commentAnnotatedBy': None, 'commentAnnotatedAt': None, 'severity': None, 'createdat': 1794703028653, 'updatedat': 1794703028653, 'allowedUserActions': ['Ignore'], 'documentName': 'IB_source_v2.0.pdf', 'documentCountry': '', 'siteName': None, 'siteId': None, 'studyId': '7a6864e8-b72e-437a-94dd-616ebd257037', 'studyName': 'TestStudy1794702404395741071', 'type': 'MANUAL', 'dependsOn': ['TMF Artifact'], 'locationType': None, 'pageIndex': None, 'xCoordinate': None, 'yCoordinate': None, 'isIgnoredBySupport': False, 'expectedValue': None, 'expectedSource': None, 'expectedCountry': None, 'expectedSite': None, 'isDiscrepancy': False, 'subartifactList': None, 'scopeList': None, 'metadataCodesWithMandatory': None, 'contentType': 'application/pdf', 'availableScopes': [], 'targetDocumentId': '543fa527-c8a1-4895-9bca-67189b12a859'}\nassert '543fa527-c8a...-67189b12",
"traceback_tail": "automation/tests/docsvc/test_document_tmf_promotion.py:379: in test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link\n assert link[\"targetDocumentId\"] == target_id, f\"link should name the target: {link}\"\nE AssertionError: link should name the target: {'tildaid': '79ae9bc1-0b71-4383-94a1-2e679cd51732', 'recId': 'NZ0174DD', 'docId': '526b44e1-4833-42cd-be1d-ddb3e36a2635', 'userAction': 'Confirm', 'status': 'confirmed', 'category': 'Version Link', 'data': '', 'dataFormatted': None, 'suggestions': None, 'explanation': None, 'comment': None, 'commentAnnotatedBy': None, 'commentAnnotatedAt': None, 'severity': None, 'createdat': 1794703028653, 'updatedat': 1794703028653, 'allowedUserActions': ['Ignore'], 'documentName': 'IB_source_v2.0.pdf', 'documentCountry': '', 'siteName': None, 'siteId': None, 'studyId': '7a6864e8-b72e-437a-94dd-616ebd257037', 'studyName': 'TestStudy1794702404395741071', 'type': 'MANUAL', 'dependsOn': ['TMF Artifact'], 'locationType': None, 'pageIndex': None, 'xCoordinate': None, 'yCoordinate': None, 'isIgnoredBySupport': False, 'expectedValue': None, 'expectedSource': None, 'expectedCountry': None, 'expectedSite': None, 'isDiscrepancy': False, 'subartifactList': None, 'scopeList': None, 'metadataCodesWithMandatory': None, 'contentType': 'application/pdf', 'availableScopes': [], 'targetDocumentId': '543fa527-c8a1-4895-9bca-67189b12a859'}\nE assert '543fa527-c8a...-67189b12a859' == '22553117-0db...-1a22ea146e5c'\nE \nE - 22553117-0db7-47be-bf57-1a22ea146e5c\nE + 543fa527-c8a1-4895-9bca-67189b12a859",
"requests": [
{
"trace_id": "a917e57adadeaaca6e3ae14a3af7e40b",
"method": "PATCH",
"path": "/api/documents/v2",
"status": "207",
"error": "None"
},
{
"trace_id": "a917e57adadeaaca6e3ae14c7eca7c81",
"method": "PUT",
"path": "/api/documents/22553117-0db7-47be-bf57-1a22ea146e5c/promote",
"status": "200",
"error": "None"
},
{
"trace_id": "a917e57adadeaaca6e3ae1484b4d0c95",
"method": "POST",
"path": "/api/documents",
"status": "200",
"error": "None"
},
{
"trace_id": "a917e57adadeaaca6e3ae14ce72ac370",
"method": "GET",
"path": "/api/documents/f9aa0194-94ad-44c3-875e-10a33fed23eb",
"status": "200",
"error": "None"
},
{
"trace_id": "a917e57adadeaaca6e3ae147600de11c",
"method": "GET",
"path": "/api/v1/docproc/recommendations",
"status": "200",
"error": "None"
}
],
"errors_the_services_logged_for_these_requests": "none: no service logged an error under these requests' trace ids"
}
Console lines about this test
{
"from": "console.log",
"lines": [
"600: ERROR E assert 14 == 13",
"601: ERROR E + where 14 = len(['Document_Download', 'Document_Copy', 'Document_Review', 'Document_eSign', 'Document_Share', 'Document_Comment', ...])",
"602: ERROR E + and 13 = len(['Document_Annotate', 'Document_Archive', 'Document_Assign', 'Document_Categorize', 'Document_Comment', 'Document_Copy', ...])",
"603: INFO _ TestDocumentTMFPromotion.test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link _",
"604: INFO automation/tests/docsvc/test_document_tmf_promotion.py:379: in test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link",
"605: INFO assert link[\"targetDocumentId\"] == target_id, f\"link should name the target: {link}\"",
"606: ERROR E AssertionError: link should name the target: {'tildaid': '79ae9bc1-0b71-4383-94a1-2e679cd51732', 'recId': 'NZ0174DD', 'docId': '526b44e1-4833-42cd-be1d-ddb3e36a2635', 'userAction': 'Confirm', 'status': 'confirmed', 'category': 'Version Link', 'data': '', 'dataFormatted': None, 'suggestions",
"607: ERROR E assert '543fa527-c8a...-67189b12a859' == '22553117-0db...-1a22ea146e5c'",
"\u2026",
"725: INFO + and 13 = len(['Document_Annotate', 'Document_Archive', 'Document_Assign', 'Document_Comment', 'Document_Copy', 'Document_Categorize', ...])",
"726: ERROR FAILED automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_documents_after_rejection - AssertionError: assert 13 == 12",
"727: ERROR FAILED automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_documents_after_updating - AssertionError: Unexpected actions found: {'Document_Enhance'}",
"728: ERROR FAILED automation/tests/docsvc/test_document_tmf_promotion.py::TestDocumentTMFPromotion::test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link - AssertionError: link should name the target: {'tildaid': '79ae9bc1-0b71-4383-94a1-2e679cd51732', 'recId': 'NZ0174DD', 'docId': '526b44",
"729: INFO assert '543fa527-c8a...-67189b12a859' == '22553117-0db...-1a22ea146e5c'",
"730: INFO - 22553117-0db7-47be-bf57-1a22ea146e5c",
"731: INFO + 543fa527-c8a1-4895-9bca-67189b12a859"
]
}
The test's history
{
"pattern": "new",
"meaning": "failed 1 run after passing the 29 before",
"newest_first": "F P P P P P P P P P P P P P P P P P P P P P P P P P P P P P",
"failing_in_a_row": 1,
"this_error_in_a_row": 1,
"this_error_since_build": 597,
"build_before_this_error": 593
}
The test's source
{
"repo": "tildabio/main",
"at": "03f9c2d6b",
"path": "e2e/automation/tests/docsvc/test_document_tmf_promotion.py",
"from_line": 338,
"failing_line": 379,
"code": "338 def test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link(self, data):\n339 \"\"\"An upload naming a TMF target lands in Staging, in that target's study, carrying a\n340 confirmed Version Link to it.\n341 \n342 The upload names no study of its own \u2014 it is taken from the target. The link is written by\n343 docproc when it picks up the upload event, so it is polled for rather than expected in the\n344 create response.\n345 \"\"\"\n346 test_headers = data[\"cro_test_headers\"]\n347 study_id = data[\"study\"][\"tildaid\"]\n348 doc_api = Document(test_headers)\n349 \n350 tmf_folders = get_tmf_folders_for_study(test_headers, study_id)\n351 ib_location = get_tmf_subartifact_for_deliverable(tmf_folders, \"Investigator's Brochure\")\n352 artifact_id, subartifact_id = ib_location[\"folderId\"], ib_location[\"subArtifactId\"]\n353 \n354 logger.info(\"Step 1: Creating a TMF target document (upload \u2192 categorize \u2192 promote)...\")\n355 target_id = _stage_and_categorize_doc(doc_api, study_id, \"IB_upl_target_v1.0.pdf\", artifact_id, subartifact_id)\n356 promote_target = doc_api.promote(target_id)\n357 assert promote_target.status_code == 200, f\"target promotion to TMF failed: {promote_target.text}\"\n358 \n359 logger.info(\"Step 2: Uploading a new version of that target, naming no study...\")\n360 upload = upload_as_next_version(test_headers, \"IB_upl_source_v2.0.pdf\", target_id)\n361 assert upload.status_code == 200, f\"upload-as-new-version failed: {upload.status_code} \u2014 {upload.text}\"\n362 source_id = upload.json()[\"tildaid\"]\n363 \n364 source_doc = doc_api.get(source_id).json()\n365 assert (\n366 source_doc[\"collection\"] == \"Staging\"\n367 ), f\"an uploaded new version belongs in Staging, got {source_doc.get('collection')}\"\n368 assert (\n369 source_doc[\"studyId\"] == study_id\n370 ), f\"source should take the target's study, got {source_doc.get('studyId')}\"\n371 # A study was named by the target, so the upload is not a context-less Draft.\n372 assert (\n373 source_doc[\"status\"] == \"Uploaded\"\n374 ), f\"an uploaded new version should not be a Draft, got {source_doc.get('status')}\"\n375 logger.info(\"\u2713 Source document is in Staging, in the target's study\")\n376 \n377 logger.info(\"Step 3: Waiting for the Version Link docproc records from the upload event...\")\n378 link = wait_for_version_link(test_headers, source_id)\n379> assert link[\"targetDocumentId\"] == target_id, f\"link should name the target: {link}\"\n380 assert link[\"status\"] == \"confirmed\", f\"an uploaded new version is already accepted: {link}\"\n381 assert link[\"type\"] == \"MANUAL\", f\"the target was chosen by a person, not proposed by AI: {link}\"\n382 logger.info(\"\u2713 Confirmed Version Link recorded on the uploaded document\")\n383 \n384 logger.info(\"Cleaning up test documents...\")\n385 doc_api.delete(source_id)\n386 doc_api.delete(target_id)\n387 \n388 def test_06_uploaded_new_version_promotes_onto_its_target(self, data):\n389 \"\"\"The link an upload creates is what makes promotion stack: the uploaded document is\n390 promoted with no target of its own and becomes a new version of the target, rather than a\n391 second TMF document.\"\"\"\n392 test_headers = data[\"cro_test_headers\"]\n393 study_id = data[\"study\"][\"tildaid\"]\n394 doc_api = Document(test_headers)\n395 \n396 tmf_folders = get_tmf_folders_for_study(test_headers, study_id)\n397 ib_location = get_tmf_subartifact_for_deliverable(tmf_folders, \"Investigator's Brochure\")\n398 artifact_id, subartifact_id = ib_location[\"folderId\"], ib_location[\"subArtifactId\"]\n399 \n400 logger.info(\"Step 1: Creating a TMF target document...\")\n401 target_id = _stage_and_categorize_doc(\n402 doc_api, study_id, \"IB_stack_target_v1.0.pdf\", artifact_id, subartifact_id\n403 )\n404 promote_target = doc_api.promote(target_id)\n405 assert promote_target.status_code == 200, f\"target promotion to TMF failed: {promote_target.text}\"\n406 \n407 logger.info(\"Step 2: Uploading a new version of it and waiting for the link...\")\n408 upload = upload_as_next_version(test_headers, \"IB_stack_source_v2.0.pdf\", target_id, study_id=study_id)"
}
Commits in the window
{
"between": "build 593 (last pass, started 2026-11-12T00:21:19Z) and build 597 (first failure of the streak, started 2026-11-15T00:26:03Z)",
"test_repo": {
"repo": "tildabio/main",
"range": "b805e7b66..03f9c2d6b",
"href": "https://github.com/tildabio/main/compare/b805e7b66c8c01e711f0566189e109e1ecb6e150...03f9c2d6b8bcadfd46ddaf810027681ae8e40891",
"total": 49,
"commits": [
{
"sha": "03f9c2d6b",
"subject": "authz: organization archive (soft delete) and purge (ENG-7837) (#17340)",
"login": "Shashank-Agrawal12",
"name": "Shashank-Agrawal12",
"date": "2026-11-13T17:58",
"touches": [
"advpsvc/internal",
"authz/main.go",
"authz/org-deletion_DESIGN.md",
"authz/pkg",
"docsvc/pkg",
"e2e/automation",
"studiosvc/pkg",
"tildaobj/model.go",
"tildaobj/pubsub_defs.go",
"tusker/pubsub",
"util/gcs",
"util/pubsublib"
]
},
{
"sha": "1dd204c8f",
"subject": "fix(dashQL): processing heatmap groups by user id and counts the Docs Processed statuses (#17434)",
"login": "mrinalraj1",
"name": "Mrinal",
"date": "2026-11-13T17:41",
"touches": [
"dashQL/charts",
"dashQL/graph"
]
},
{
"sha": "b463423fe",
"subject": "tmfsync: Veeva always syncs in bulk, with intervals from 15 minutes (#17412)",
"login": "krishnaatluru-cpu",
"name": "Krishna Chaitanya",
"date": "2026-11-13T17:18",
"touches": [
"data-science/tmfsync"
]
},
{
"sha": "00fbe7774",
"subject": "[E2E]: bootstrap update (#17369)",
"login": "sbadiger",
"name": "Santosh Badiger",
"date": "2026-11-13T14:06",
"touches": [
"tctl/example"
]
},
{
"sha": "b709cd98e",
"subject": "[E2E]: update to user permission for bootstrap (#16732)",
"login": "sbadiger",
"name": "Santosh Badiger",
"date": "2026-11-13T14:03",
"touches": [
"tctl/example"
]
},
{
"sha": "d636ea6fa",
"subject": "Fix manual document sharing (#17427)",
"login": "pralim",
"name": "Prasad",
"date": "2026-11-13T12:55",
"touches": [
"docsvc/pkg"
]
},
{
"sha": "3103c65d7",
"subject": "Retire GET /api/documents/v2/{documentID} in favor of POST .../view (#17423)",
"login": "vishal23karedla",
"name": "Vishal Karedla",
"date": "2026-11-13T12:53",
"touches": [
"data-science/docproc",
"docsvc/pkg",
"docsvc/routes",
"e2e/automation",
"tctl/doc"
]
},
{
"sha": "e0e36707e",
"subject": "fix: removing a CC in AI chat reaches the work order's draft (ENG-8482) (#17366)",
"login": "TadasValaitiz",
"name": "Tadas Valaitis",
"date": "2026-11-13T12:46",
"touches": [
"data-science/chat-agent",
"data-science/packages",
"data-science/virtual_assistant"
]
},
{
"sha": "3e5ce671e",
"subject": "feat(studiosvc): add GET /api/studio/activities/{id}/objectCounts (ENG-4808) (#17428)",
"login": "poojalodhi",
"name": "Pooja Lodhi",
"date": "2026-11-13T12:32",
"touches": [
"studiosvc/pkg"
]
},
{
"sha": "862429c0a",
"subject": "studiosvc: flag rules whose compared choices no longer exist when a question's choices change (ENG-6755) (#17179)",
"login": "sanchitmishra08",
"name": "sanchitmishra08",
"date": "2026-11-13T11:57",
"touches": [
"common/graphlib",
"studiosvc/pkg",
"tildaobj/studio_obj_defs.go"
]
},
{
"sha": "4f8a585a2",
"subject": "Test visit activity notes, questions, visit summary and investigator select (execsvc v1) (ENG-8554) (#17281)",
"login": "tilda-gitbot[bot]",
"name": "tilda-gitbot[bot]",
"date": "2026-11-13T10:31"
},
{
"sha": "7e5e884ce",
"subject": "fix(doclib): publish the dashboards delete event from every hard delete (#17389)",
"login": "mrinalraj1",
"name": "Mrinal",
"date": "2026-11-13T08:49"
},
{
"sha": "49b945d98",
"subject": "Test the studies list: org admin vs member membership and per-status counts (TC-STD-006, TC-STD-101, TC-STD-10 (ENG-8641) (#17358)",
"login": "tilda-gitbot[bot]",
"name": "tilda-gitbot[bot]",
"date": "2026-11-13T06:37"
},
{
"sha": "83b37c21f",
"subject": "Studio API: cover study configuration drafts, completed-visit locks and canvas block edits (ENG-8648) (#17359)",
"login": "tilda-gitbot[bot]",
"name": "tilda-gitbot[bot]",
"date": "2026-11-13T06:10"
},
{
"sha": "e0b8dc44d",
"subject": "Add API tests for the 7 uncovered tusker task routes (inboxes, assignment, bulk/single update, categories, sta (ENG-8483) (#17220)",
"login": "tilda-gitbot[bot]",
"name": "tilda-gitbot[bot]",
"date": "2026-11-13T06:03"
},
{
"sha": "89e9249fc",
"subject": "studiosvc: show in-protocol and codelist edits in the Studio audit log (ENG-7019) (#17365)",
"login": "susheelkumar-cmyk",
"name": "susheelkumar-cmyk",
"date": "2026-11-13T05:38"
},
{
"sha": "b7b792509",
"subject": "fix(feedsvc): accept legacy time zone names like Asia/Calcutta (#17417)",
"login": "mvelamatt",
"name": "murali krishna velamati",
"date": "2026-11-13T05:02"
},
{
"sha": "7676bf4e2",
"subject": "feat(edl): EDL plans on sponsor roles; mapping changes move rows over Pub/Sub (ENG-8626) (#17415)",
"login": "mvelamatt",
"name": "murali krishna velamati",
"date": "2026-11-13T02:49"
},
{
"sha": "a005f890d",
"subject": "Cover the Tilda Scale admin routes: delegations, alias rename, platform capabilities, checkauth, user delete (ENG-8570) (#17319)",
"login": "tilda-gitbot[bot]",
"name": "tilda-gitbot[bot]",
"date": "2026-11-13T01:33"
},
{
"sha": "82c72484f",
"subject": "Study team and site training log populations (#17409)",
"login": "taylorfutral",
"name": "Taylor",
"date": "2026-11-13T00:38"
},
{
"sha": "ea8ac3400",
"subject": "feedsvc: EDL labels and scope rows, no empty scope approvals, documents card leads with QC (ENG-8627) (#17413)",
"login": "mvelamatt",
"name": "murali krishna velamati",
"date": "2026-11-13T00:36"
},
{
"sha": "f4cbcd9d2",
"subject": "fix(execsvc): status returns rows saved under hdmObjId and full document details (ENG-5239) (#17399)",
"login": "danherberttilda",
"name": "Dan Herbert",
"date": "2026-11-12T21:45"
},
{
"sha": "9976e91e8",
"subject": "fix(studiosvc): return the statement's variable name and state in the list API (ENG-7501) (#17411)",
"login": "danherberttilda",
"name": "Dan Herbert",
"date": "2026-11-12T21:44"
},
{
"sha": "a910115f9",
"subject": "tmfsync: separate Valkey queue and leader keys per environment (#17392)",
"login": "krishnaatluru-cpu",
"name": "Krishna Chaitanya",
"date": "2026-11-12T21:16"
},
{
"sha": "681f8cc47",
"subject": "studiosvc: import the protocol studioai extracts from a study's documents, on pub/sub (ENG-3080) (#17410)",
"login": "sureshboddapati",
"name": "Suresh Boddapati",
"date": "2026-11-12T21:14"
}
]
}
}
The issue as the agent wrote it
**Fix is in:** the automation suite (e2e): the test is wrong.
**What failed:** `AssertionError: link should name the target: {'tildaid': '79ae9bc1-0b71-4383-94a1-2e679cd51732', 'recId': 'NZ0174DD', 'docId': '526b44e1-4833-42cd-be1d-ddb3e36a2635', 'userAction': 'Confirm', 'status': 'confirmed', 'category': 'Version Link`
**The test is wrong**, confidence medium. Found in `api-tests-master` build 597: [run in X-ray](https://xray.tilda.pizza/tests/run/api-tests-master/597).
The test gets a Version Link that belongs to another document. Its documentName is IB_source_v2.0.pdf, which is the source file in test_02, not the IB_upl_source_v2.0.pdf this test uploads.
Cause: e2e/automation/models/recommendations.py:14 sends the query params `doc_id` and `include_support_ignored`. In data-science/docproc/src/api/recommendations_router.py:599 the param is now `alias="docId"`, and line 611 is `alias="includeSupportIgnored"`. Blame on line 599 gives 9b80cb7b6 (camelCase API params, Nov 12), which landed after the last pass (build 593).
With `doc_id` ignored, the list endpoint returns recommendations for every visible document. wait_for_version_link (doc_helper.py:356-370) takes the first Version Link in that list, so it can return another test's link.
I did not check why builds 594-596 are missing from the history, or whether that commit also edited e2e. Both could explain why this only failed now.
Other tests that call Recommendations.get_by_document_id probably have the same problem. The Document_Enhance and action-count failures in the console are different errors.
**Suspect commit:** [9b80cb7b6](https://github.com/tildabio/main/commit/9b80cb7b60fe2b6516a17a26ecc5c901fd479912) Use camelCase for API query params and JSON fields across Go and Pyth… (arzatskis)
**Assigned to:** [email protected] (last changed test_document_tmf_promotion.py (b1537332f); the test agent opens the pull request once this is in Ready for Development).
**Proposed fix:**
In e2e/automation/models/recommendations.py get_by_document_id, change the params to {"docId": doc_id, "limit": limit, "includeSupportIgnored": include_support_ignored}. In wait_for_version_link, also require item.get("docId") == doc_id so a stray link cannot satisfy the wait. Check other callers of the recommendations list for snake_case params.
**Failing tests (1):**
- [automation/tests/docsvc/test_document_tmf_promotion.py::TestDocumentTMFPromotion::test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link](https://xray.tilda.pizza/tests/case/e7d124b3022f55cd) (new in this run)
**Error:**
```
AssertionError: link should name the target: {'tildaid': '79ae9bc1-0b71-4383-94a1-2e679cd51732', 'recId': 'NZ0174DD', 'docId': '526b44e1-4833-42cd-be1d-ddb3e36a2635', 'userAction': 'Confirm', 'status': 'confirmed', 'category': 'Version Link', 'data': '', 'dataFormatted': None, 'suggestions': None, 'explanation': None, 'comment': None, 'commentAnnotatedBy': None, 'commentAnnotatedAt': None, 'severity': None, 'createdat': 1794703028653, 'updatedat': 1794703028653, 'allowedUserActions': ['Ignore'], 'documentName': 'IB_source_v2.0.pdf', 'documentCountry': '', 'siteName': None, 'siteId': None, 'studyId': '7a6864e8-b72e-437a-94dd-616ebd257037', 'studyName': 'TestStudy1794702404395741071', 'type': 'MANUAL', 'dependsOn': ['TMF Artifact'], 'locationType': None, 'pageIndex': None, 'xCoordinate': None, 'yCoordinate': None, 'isIgnoredBySupport': False, 'expectedValue': None, 'expectedSource': None,
```
The test agent picks this ticket up and opens the pull request.
```yaml
suite: api
feature: fix-test-document-tmf-promotion
find: true
fix: true
target_file: e2e/automation/tests/docsvc/test_document_tmf_promotion.py
failing_tests:
- automation/tests/docsvc/test_document_tmf_promotion.py::TestDocumentTMFPromotion::test_05_upload_as_new_version_lands_in_staging_with_a_confirmed_link
acceptance:
- Each test in failing_tests passes on the automation cluster.
- 'No assertion is weakened to make a test pass: the test still checks the behaviour it was written for.'
request: 'Fix existing tests that fail on master. Do not write new coverage.
Error: AssertionError: link should name the target: {''tildaid'': ''79ae9bc1-0b71-4383-94a1-2e679cd51732'',
''recId'': ''NZ0174DD'', ''docId'': ''526b44e1-4833-42cd-be1d-ddb3e36a2635'', ''userAction'': ''Confirm'',
''status'': ''confirmed'', ''category'': ''Version Link'', ''data'': '''', ''dataFormatted'': None,
''suggestions'': None, ''explanation'': None, ''comment'': None, ''commentAnnotatedBy'': None, ''commentAnnotatedAt'':
None, ''severi
Diagnosis: The test gets a Version Link that belongs to another document. Its documentName is IB_source_v2.0.pdf,
which is the source file in test_02, not the IB_upl_source_v2.0.pdf this test uploads.
Cause: e2e/automation/models/recommendations.py:14 sends the query params `doc_id` and `include_support_ignored`.
In data-science/docproc/src/api/recommendations_router.py:599 the param is now `alias="docId"`, and
line 611 is `alias="includeSupportIgnored"`. Blame on line 599 gives 9b80cb7b6 (camelCase API params,
Nov 12), which landed after the last pass (build 593).
With `doc_id` ignored, the list endpoint returns recommendations for every visible document. wait_for_version_link
(doc_helper.py:356-370) takes the first Version Link in that list, so it can return another test''s
link.
I did not check why builds 594-596 are missing from the history, or whether that commit also edited
e2e. Both could explain why this only failed now.
Other tests that call Recommendations.get_by_document_id probably have the same problem. The Document_Enhance
and action-count failures in the console are different errors.
Proposed change: In e2e/automation/models/recommendations.py get_by_document_id, change the params to
{"docId": doc_id, "limit": limit, "includeSupportIgnored": include_support_ignored}. In wait_for_version_link,
also require item.get("docId") == doc_id so a stray link cannot satisfy the wait. Check other callers
of the recommendations list for snake_case params.'
```
+++ Agent notes
Filed by X-ray's triage agent. Models asked: claude-sonnet-5-5; settled by deep; 14 lookups in the code and its history.
Group `triage:57bc627c3ec158` (one issue per root cause).
A wrong verdict can be corrected on the run page in X-ray.
+++