[Test failure] Document action list now includes Document_Enhance; test expects exact old list (6 tests)
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-8844 · Completed
- Owner
- [email protected] (last changed test_document_review.py (b1080c587); the test agent opens the pull request once this is in Ready for Development)
- Filed in
- Backlog, Test Agent Automation
- Service
- docsvc
- History when filed
- new, this error since build 597
- Suspect commit
- 7713ce278 Offer enhancement on Staging documents (#17451) (pralim)
- Branches
- fails on master only: production is unaffected (api-tests-production build 620). Fix it before master is released to production.
The test asserts an exact action list, and docsvc now returns one more action, Document_Enhance. It fails at test_document_review.py:282 (14 actions vs 13).
Commit 7713ce278 "Offer enhancement on Staging documents" (#17451) changed docsvc/pkg/models/document/actionList.go. `add(notInStaging && unlinked, DOC_ACTION_ENHANCE)` became `add(true, DOC_ACTION_ENHANCE)`. Upload-task documents sit in Staging, so they now get Enhance.
The commit looks intended, and it did not touch the e2e tests. No commit has touched test_document_review.py since build 593, and `Document_Enhance` appears nowhere under e2e.
Other tests in this class assert exact lists, including test_documents_after_rejection (lines 297-318). I read only that one and the failing test, so check the rest for the same assertion.
Not verified: whether 7713ce278 was in the docsvc image these tests ran against. docsvc was redeployed 33 minutes into the run, so the image may have changed mid-run. The extra action matches the diff, so I think it was.
Proposed fix
In test_document_review.py, add "Document_Enhance" to the expected_actions lists. That covers test_review_task_for_pi (line 263), test_documents_after_rejection (line 297) and the same lists in the other failing tests. Then re-check the PI, current-user and post-upload assertions. If Enhance should still be hidden for these documents, ask the author of #17451 (pralim) instead, and treat it as a product bug.
History of this root cause
- filed ENG-8844 · build 597 8d ago
The test is wrong, confidence medium; 6 tests; to [email protected] in Backlog
- branches ENG-8844 7d ago
Tests 6
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_documents_after_rejection DocumentReview |
did not run | ||
| test_task_after_certification DocumentReview |
did not run | ||
| test_documents_after_updating DocumentReview |
did not run | ||
| test_review_task_for_pi DocumentReview |
did not run | ||
| test_task_after_documents_upload DocumentReview |
did not run | ||
| test_review_task_for_current_user DocumentReview |
did not run |
How the agent decided
- Models
- claude-sonnet-5-5 ($0.25, 9 lookups)
- Settled by
- the investigating model
- Cost
- $0.25
What it looked up (9, in order)
1. search_code repo=main, text=Document_Enhance · 864 chars back
docsvc/pkg/models/document/model.go
177: DOC_ACTION_ENHANCE = "Document_Enhance" //@enum-replace-doc-actions
data-science/packages/tilda-backend-client/tilda_backend_client/_generated/document/types.py
666: action_list: Annotated[list[Annotated[Literal['Document_AI_Review', 'Document_Move_to_AI_Review', 'Document_Assign_to_AI', 'Document_AI_Clean_Refresh', 'Document_Act_on_AI_Recommendations', 'Document_
786: action_list: Annotated[Optional[list[Annotated[Literal['Document_AI_Review', 'Document_Move_to_AI_Review', 'Document_Assign_to_AI', 'Document_AI_Clean_Refresh', 'Document_Act_on_AI_Recommendations', '
1022: action_list: Annotated[list[Annotated[Literal['Document_AI_Review', 'Document_Move_to_AI_Review', 'Document_Assign_to_AI', 'Document_AI_Clean_Refresh', 'Document_Act_on_AI_Recommendations', 'Document_
2. commits repo=main, path=docsvc/pkg, since=2026-11-12T00:00:00Z · 1478 chars back
ba6f15e5f 2026-11-15T00:55 mvelamatt: Site startup suggestion card: EDL purpose + feedsvc detector (ENG-8842) (#17460)
7713ce278 2026-11-14T15:13 pralim: Offer enhancement on Staging documents (#17451)
79ae4b89e 2026-11-14T06:29 taylorfutral: Auto-fill certificate Completed On and Issued On from Training.CompletedOn (#17445)
485603b7e 2026-11-13T18:04 tilda-gitbot[bot]: fix(dashboards): moved docs in org-wide charts, document rows from the published state, drop documents.previousStatus, Draft via pending upload (ENG-7101, ENG-8
03f9c2d6b 2026-11-13T17:58 Shashank-Agrawal12: authz: organization archive (soft delete) and purge (ENG-7837) (#17340)
d636ea6fa 2026-11-13T12:55 pralim: Fix manual document sharing (#17427)
3103c65d7 2026-11-13T12:53 vishal23karedla: Retire GET /api/documents/v2/{documentID} in favor of POST .../view (#17423)
7e5e884ce 2026-11-13T08:49 mrinalraj1: fix(doclib): publish the dashboards delete event from every hard delete (#17389)
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)
1668b4e57 2026-11-12T18:44 vishal23karedla: Record the timestamp when a Document gets promoted to TMF (#17396)
08a0616d0 2026-11-12T10:17 mrinalraj1: fix(docsvc): list the study team as assignees on site-level documents (ENG-8621) (#17373)
9a785b20c 2026-11-12T07:26 vishal23karedla: GetDocumentv2 enhancements to support chat agent use cases (#17382)
3. commit_diff repo=main, sha=7713ce278 · 2688 chars back
7713ce278 2026-11-14T15:13 pralim: Offer enhancement on Staging documents (#17451)
5 files changed: common/doclib/annotation.go, common/doclib/createDocument.go, docsvc/pkg/models/document/actionList.go, docsvc/pkg/models/document/annotation.go, docsvc/pkg/models/document/updateDocument.go
--- common/doclib/annotation.go
@@ -504,13 +504,6 @@ func UpdateInstanceInTrans(ctx context.Context, tr tildadb.DBTrans, org *tildaob
return anno.DocAnnotationRevision, nil
}
-func ValidAnnotation(doc *tildaobj.Document, anno *DocAnnotationSpec) error {
- if doc.VisitId != "" || doc.PatientId != "" || doc.UserId != "" {
- return fmt.Errorf("Cannot add annotation to patient/visit/user specific document: %w", api.ErrBadRequest)
- }
- return nil
-}
-
func AddOrUpdateAnnotation(ctx context.Context, tx tildadb.DBTrans, org *tildaobj.Organization, user *tildaobj.User, doc tildaobj.Document, annotation *DocAnnotationSpec) error {
isCreate := annotation.Id == ""
zaplogger.DebugCtx(ctx, "adding or updating document annotation", zap.String("docId", doc.Id), zap.String("orgId", org.Id), zap.String("annotationId", annotation.Id), zap.Bool("isCreate", isCreate))
--- common/doclib/createDocument.go
@@ -706,11 +706,7 @@ func CreateDocument(ctx context.Context, tr tildadb.DBTrans, org *tildaobj.Organ
// Annotation processing
if inputs.Annotation != nil {
// 1. If annotation inputs are provided, add those to the new document
- err := ValidAnnotation(document, inputs.Annotation)
- if er
… (1188 more characters not kept)
4. commits repo=main, path=e2e/automation/tests/docsvc/document_review/test_document_review.py, since=2026-11-12T00:00:00Z · 38 chars back
no commits to that path in that window
5. search_code repo=main, text=Document_Enhance, path_prefix=e2e · 30 chars back
no match on the default branch
6. read_file repo=main, path=docsvc/pkg/models/document/actionList.go, start_line=150, end_line=225 · 3292 chars back
docsvc/pkg/models/document/actionList.go (345 lines), lines 150-225:
150
151 if handlePipeline {
152 // Pipeline operator. Ready for TMF / Needs Attention were held above.
153 if inStaging {
154 add(true, DOC_ACTION_AI_CLEAN_REFRESH)
155 add(len(document.NeedsAttentionReasons) == 0, DOC_ACTION_NEED_ATTENTION)
156 }
157 switch {
158 case !croFlow:
159 case inDataset:
160 add(true, DOC_ACTION_ACT_ON_AI_RECOMMENDATIONS)
161 add(true, DOC_ACTION_ACT_ON_QC_FINDINGS)
162 case inStaging:
163 switch stateTag {
164 case doclib.DOC_STATE_TAG_AI_REVIEW:
165 add(true, DOC_ACTION_ACT_ON_AI_RECOMMENDATIONS)
166 add(true, DOC_ACTION_ACT_ON_QC_FINDINGS)
167 add(true, DOC_ACTION_ASSIGN_TO_AI)
168 case doclib.DOC_STATE_TAG_MANUAL:
169 add(true, DOC_ACTION_AI_REVIEW)
170 add(true, DOC_ACTION_READY_FOR_TMF)
171 case doclib.DOC_STATE_TAG_TO_BE_CORRECTED:
172 add(true, DOC_ACTION_READY_FOR_TMF)
173 }
174 }
175 } else if croFlow && (inStaging || inDataset || inTMF) {
176 // Everyone else: review AI output, then promote to TMF.
177 add(inStaging || inDataset, DOC_ACTION_ACT_ON_AI_RECOMMENDATIONS)
178 add(true, DOC_ACTION_ACT_ON_QC_FINDINGS)
179 add(inStaging && stateTag == doclib.DOC_STATE_TAG_MANUAL, DOC_ACTION_AI_REVIEW)
180 add(inStaging && slices.Contains(promotableTags, stateTag), DOC_ACTION_PROMOTE_TO_TMF)
181 }
182 }
183
184 // Read-only, or a document shared from another org: no
… (1792 more characters not kept)
7. blame repo=main, path=docsvc/pkg/models/document/actionList.go, start_line=199, end_line=220 · 936 chars back
lines 199-202: 92ca7f423 2026-10-06T16:28 pralim: Fix mark as reviewed button for signers and non-signers (#16393)
lines 203-204: ea9dc0e5c 2026-10-23T03:53 pralim: Document review improvements (#16705)
lines 205-209: 92ca7f423 2026-10-06T16:28 pralim: Fix mark as reviewed button for signers and non-signers (#16393)
lines 210-210: ea9dc0e5c 2026-10-23T03:53 pralim: Document review improvements (#16705)
lines 211-211: 92ca7f423 2026-10-06T16:28 pralim: Fix mark as reviewed button for signers and non-signers (#16393)
lines 212-212: ea9dc0e5c 2026-10-23T03:53 pralim: Document review improvements (#16705)
lines 213-218: 92ca7f423 2026-10-06T16:28 pralim: Fix mark as reviewed button for signers and non-signers (#16393)
lines 219-219: 7713ce278 2026-11-14T15:13 pralim: Offer enhancement on Staging documents (#17451)
lines 220-220: 92ca7f423 2026-10-06T16:28 pralim: Fix mark as reviewed button for signers and non-signers (#16393)
8. commit_diff repo=main, sha=7713ce278, path=docsvc/pkg/models/document/actionList.go · 1228 chars back
7713ce278 2026-11-14T15:13 pralim: Offer enhancement on Staging documents (#17451)
5 files changed: common/doclib/annotation.go, common/doclib/createDocument.go, docsvc/pkg/models/document/actionList.go, docsvc/pkg/models/document/annotation.go, docsvc/pkg/models/document/updateDocument.go
--- docsvc/pkg/models/document/actionList.go
@@ -203,7 +203,6 @@ func GetActionList(document *DocSummaryInternal, filters filtering.DocAllFilters
// Field values sit on the current upload's layout, so a filled document takes no new upload.
filled := details != nil && doclib.FieldFilled(details.AnnotationVal)
certifiable := status == tildaobj.DOC_STATUS_UPLOADED || status == tildaobj.DOC_STATUS_UPLOAD_PENDING
- unlinked := document.PatientId == "" && document.UserId == "" && document.VisitId == ""
// Review & sign
add(true, DOC_ACTION_COMMENT)
@@ -217,7 +216,7 @@ func GetActionList(document *DocSummaryInternal, filters filtering.DocAllFilters
add(true, DOC_ACTION_CATEGORIZE)
add(certifiable && stateTag != doclib.DOC_STATE_TAG_NEEDS_ATTENTION, DOC_ACTION_CERTIFY)
add(true, DOC_ACTION_ARCHIVE)
- add(notInStaging && unlinked, DOC_ACTION_ENHANCE)
+ add(true, DOC_ACTION_ENHANCE)
return actions, signerIds
}
9. commit_diff repo=main, sha=ba6f15e5f, path=docsvc/pkg/models/document/actionList.go · 3080 chars back
ba6f15e5f 2026-11-15T00:55 mvelamatt: Site startup suggestion card: EDL purpose + feedsvc detector (ENG-8842) (#17460)
26 files changed: data-science/chat-agent/src/chat_agent/tools/event_management/event_create_draft.py, data-science/chat-agent/src/infra/backend/types.py, data-science/chat-agent/tests/chat_agent/tools/test_card_links.py, data-science/chat-agent/tests/chat_agent/tools/test_edl_plan_tools.py, data-science/feedsvc/src/detectors/site_startup.py, data-science/feedsvc/src/feed/catalog.py, data-science/feedsvc/src/feed/items.py, data-science/feedsvc/src/graph/discovery.py, data-science/feedsvc/src/ingest/docsvc.py, data-science/feedsvc/src/ingest/site_startup.py, data-science/feedsvc/src/ingest/studies.py, data-science/feedsvc/tests/e2e/site_startup_e2e.py, data-science/feedsvc/tests/e2e/site_startup_ui.py, data-science/feedsvc/tests/test_ingest.py, data-science/feedsvc/tests/test_site_startup_detector.py, data-science/feedsvc/tests/test_site_startup_ingest.py, data-science/feedsvc/tests/test_sweep.py, data-science/feedsvc/tests/test_todo.py, data-science/packages/tilda-backend-client/tilda_backend_client/_generated/event/__init__.py, data-science/packages/tilda-backend-client/tilda_backend_client/_generated/event/client.py, data-science/packages/tilda-backend-client/tilda_backend_client/_generated/event/types.py, docsvc/pkg/handlers/events.go, docsvc/pkg/models/event/event.go, docsvc/pkg/models/event/event_purpose_test.go, docsvc/pkg/models/event/event_template_ad
… (1580 more characters not kept)
What it was shown (build 597, 27.9 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": 6,
"suite": "DocumentReview",
"members": [
{
"test": "automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_task_after_documents_upload",
"pattern": "intermittent",
"meaning": "2 failures in 30 runs, 1 in a row now",
"newest_first": "F P P P P P P P P P P P P P P F 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
},
{
"test": "automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_task_after_certification",
"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
},
{
"test": "automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_review_task_for_current_user",
"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
},
{
"test": "automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_review_task_for_pi",
"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
},
{
"test": "automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_documents_after_updating",
"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
},
{
"test": "automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_documents_after_rejection",
"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/document_review/test_document_review.py::TestDocumentReview::test_review_task_for_pi",
"status": "failed",
"message": "AssertionError: Unexpected actions found: {'Document_Enhance'}\nassert 14 == 13\n + where 14 = len(['Document_Download', 'Document_Copy', 'Document_Review', 'Document_eSign', 'Document_Share', 'Document_Comment', ...])\n + and 13 = len(['Document_Annotate', 'Document_Archive', 'Document_Assign', 'Document_Comment', 'Document_Copy', 'Document_Categorize', ...])",
"traceback_tail": "automation/tests/docsvc/document_review/test_document_review.py:282: in test_review_task_for_pi\n assert len(document[\"actionList\"]) == len(\nE AssertionError: Unexpected actions found: {'Document_Enhance'}\nE assert 14 == 13\nE + where 14 = len(['Document_Download', 'Document_Copy', 'Document_Review', 'Document_eSign', 'Document_Share', 'Document_Comment', ...])\nE + and 13 = len(['Document_Annotate', 'Document_Archive', 'Document_Assign', 'Document_Comment', 'Document_Copy', 'Document_Categorize', ...])",
"requests": [
{
"trace_id": "a917e57adadeaac1b98cfc6f271166cc",
"method": "GET",
"path": "/api/documents/tasks/695571f0-65ab-4eea-8750-b25202df6ea4",
"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": [
"583: ERROR E assert 14 == 13",
"584: ERROR E + where 14 = len(['Document_Download', 'Document_Copy', 'Document_Review', 'Document_eSign', 'Document_Share', 'Document_Comment', ...])",
"585: ERROR E + and 13 = len(['Document_Annotate', 'Document_Archive', 'Document_Assign', 'Document_Categorize', 'Document_Comment', 'Document_Copy', ...])",
"586: ERROR __________________ TestDocumentReview.test_review_task_for_pi __________________",
"587: INFO assert len(document[\"actionList\"]) == len(",
"588: ERROR E AssertionError: Unexpected actions found: {'Document_Enhance'}",
"589: ERROR E assert 14 == 13",
"\u2026",
"719: INFO assert 14 == 13",
"720: INFO + where 14 = len(['Document_Download', 'Document_Copy', 'Document_Review', 'Document_eSign', 'Document_Share', 'Document_Comment', ...])",
"721: INFO + and 13 = len(['Document_Annotate', 'Document_Archive', 'Document_Assign', 'Document_Categorize', 'Document_Comment', 'Document_Copy', ...])",
"722: ERROR FAILED automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_review_task_for_pi - AssertionError: Unexpected actions found: {'Document_Enhance'}",
"723: INFO assert 14 == 13",
"724: INFO + where 14 = len(['Document_Download', 'Document_Copy', 'Document_Review', 'Document_eSign', 'Document_Share', 'Document_Comment', ...])",
"725: INFO + and 13 = len(['Document_Annotate', 'Document_Archive', 'Document_Assign', 'Document_Comment', 'Document_Copy', 'Document_Categorize', ...])"
]
}
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/document_review/test_document_review.py",
"from_line": 252,
"failing_line": 282,
"code": "252 def test_review_task_for_pi(self, submit_upload_task, build_org_header, get_token_pi):\n253 test_headers = submit_upload_task[\"test_headers\"]\n254 review_task_id = submit_upload_task[\"review_task_id\"]\n255 \n256 alias = test_headers[\"Organization\"]\n257 new_header = build_org_header(get_token_pi, alias)\n258 review_task_response = DocumentTask(new_header).get(review_task_id).json()\n259 \n260 assert review_task_response[\"actionList\"] == [\"Subject_Screenfail\", \"DocTask_ESign\"]\n261 for _, document in enumerate(review_task_response[\"taskDocuments\"]):\n262 # Check each expected action individually\n263 expected_actions = [\n264 \"Document_Annotate\",\n265 \"Document_Archive\",\n266 \"Document_Assign\",\n267 \"Document_Comment\",\n268 \"Document_Copy\",\n269 \"Document_Categorize\",\n270 \"Document_Download\",\n271 \"Document_Reject\",\n272 \"Document_Replace\",\n273 \"Document_Rename\",\n274 \"Document_Share\",\n275 \"Document_eSign\",\n276 \"Document_Review\",\n277 ]\n278 # Verify all expected actions are present\n279 for action in expected_actions:\n280 assert action in document[\"actionList\"], f\"Expected action {action} not found in actionList\"\n281 # Verify no unexpected actions are present\n282> assert len(document[\"actionList\"]) == len(\n283 expected_actions\n284 ), f\"Unexpected actions found: {set(document['actionList']) - set(expected_actions)}\"\n285 \n286 def test_documents_after_rejection(self, reject_documents):\n287 rejected_document1 = reject_documents[\"rejected_document1\"]\n288 rejected_document2 = reject_documents[\"rejected_document2\"]\n289 pi_headers = reject_documents[\"pi_headers\"]\n290 \n291 response1 = Document(pi_headers).get(rejected_document1).json()\n292 response2 = Document(pi_headers).get(rejected_document2).json()\n293 \n294 assert response1[\"status\"] == \"Needs Correction\"\n295 assert response2[\"status\"] == \"Needs Correction\"\n296 \n297 expected_actions = [\n298 \"Document_Annotate\",\n299 \"Document_Archive\",\n300 \"Document_Assign\",\n301 \"Document_Categorize\",\n302 \"Document_Comment\",\n303 \"Document_Copy\",\n304 \"Document_Download\",\n305 \"Document_eSign\",\n306 \"Document_Review\",\n307 \"Document_Rename\",\n308 \"Document_Replace\",\n309 \"Document_Share\",\n310 ]\n311 \n312 # Check that response1 has exactly the expected actions\n313 assert len(response1[\"actionList\"]) == len(expected_actions)\n314 for action in expected_actions:\n315 assert action in response1[\"actionList\"]\n316 \n317 # Check that response2 has exactly the expected actions\n318 assert len(response2[\"actionList\"]) == len(expected_actions)\n319 for action in expected_actions:\n320 assert action in response2[\"actionList\"]\n321 \n322 @pytest.mark.usefixtures(\"require_review_assigned\")"
}
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: Unexpected actions found: {'Document_Enhance'}`
**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 asserts an exact action list, and docsvc now returns one more action, Document_Enhance. It fails at test_document_review.py:282 (14 actions vs 13).
Commit 7713ce278 "Offer enhancement on Staging documents" (#17451) changed docsvc/pkg/models/document/actionList.go. `add(notInStaging && unlinked, DOC_ACTION_ENHANCE)` became `add(true, DOC_ACTION_ENHANCE)`. Upload-task documents sit in Staging, so they now get Enhance.
The commit looks intended, and it did not touch the e2e tests. No commit has touched test_document_review.py since build 593, and `Document_Enhance` appears nowhere under e2e.
Other tests in this class assert exact lists, including test_documents_after_rejection (lines 297-318). I read only that one and the failing test, so check the rest for the same assertion.
Not verified: whether 7713ce278 was in the docsvc image these tests ran against. docsvc was redeployed 33 minutes into the run, so the image may have changed mid-run. The extra action matches the diff, so I think it was.
**Suspect commit:** [7713ce278](https://github.com/tildabio/main/commit/7713ce278d91763a8facfe73de34d8a2f7850bdd) Offer enhancement on Staging documents (#17451) (pralim)
**Service:** docsvc
**Assigned to:** [email protected] (last changed test_document_review.py (b1080c587); the test agent opens the pull request once this is in Ready for Development).
**Proposed fix:**
In test_document_review.py, add "Document_Enhance" to the expected_actions lists. That covers test_review_task_for_pi (line 263), test_documents_after_rejection (line 297) and the same lists in the other failing tests. Then re-check the PI, current-user and post-upload assertions. If Enhance should still be hidden for these documents, ask the author of #17451 (pralim) instead, and treat it as a product bug.
**Failing tests (6):**
- [automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_task_after_documents_upload](https://xray.tilda.pizza/tests/case/b041a1774cef8b44) (new in this run)
- [automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_task_after_certification](https://xray.tilda.pizza/tests/case/6570da63ced8d54b) (new in this run)
- [automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_review_task_for_current_user](https://xray.tilda.pizza/tests/case/c2da557d1040e0ae) (new in this run)
- [automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_review_task_for_pi](https://xray.tilda.pizza/tests/case/ab7e1390eaff5ea6) (new in this run)
- [automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_documents_after_updating](https://xray.tilda.pizza/tests/case/8543cf503da8891c) (new in this run)
- [automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_documents_after_rejection](https://xray.tilda.pizza/tests/case/1e3078d03e30a88e) (new in this run)
**Error:**
```
AssertionError: Unexpected actions found: {'Document_Enhance'}
assert 14 == 13
+ where 14 = len(['Document_Download', 'Document_Copy', 'Document_Review', 'Document_eSign', 'Document_Share', 'Document_Comment', ...])
+ and 13 = len(['Document_Annotate', 'Document_Archive', 'Document_Assign', 'Document_Comment', 'Document_Copy', 'Document_Categorize', ...])
```
The test agent picks this ticket up and opens the pull request.
```yaml
suite: api
feature: fix-test-document-review
find: true
fix: true
target_file: e2e/automation/tests/docsvc/document_review/test_document_review.py
failing_tests:
- automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_task_after_documents_upload
- automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_task_after_certification
- automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_review_task_for_current_user
- automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_review_task_for_pi
- automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_documents_after_updating
- automation/tests/docsvc/document_review/test_document_review.py::TestDocumentReview::test_documents_after_rejection
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.\nError: AssertionError: Unexpected\
\ actions found: {'Document_Enhance'}\nassert 14 == 13\n + where 14 = len(['Document_Download', 'Document_Copy',\
\ 'Document_Review', 'Document_eSign', 'Document_Share', 'Document_Comment', ...])\n + and 13 = len(['Document_Annotate',\
\ 'Document_Archive', 'Document_Assign', 'Document_Comment', 'Document_Copy', 'Document_Categorize',\
\ ...])\nDiagnosis: The test asserts an exact action list, and docsvc now returns one more action, Document_Enhance.\
\ It fails at test_document_review.py:282 (14 actions vs 13).\nCommit 7713ce278 \"Offer enhancement\
\ on Staging documents\" (#17451) changed docsvc/pkg/models/document/actionList.go. `add(notInStaging\
\ && unlinked, DOC_ACTION_ENHANCE)` became `add(true, DOC_ACTION_ENHANCE)`. Upload-task documents sit\
\ in Staging, so they now get Enhance.\nThe commit looks intended, and it did not touch the e2e tests.\
\ No commit has touched test_document_review.py since build 593, and `Document_Enhance` appears nowhere\
\ under e2e.\nOther tests in this class assert exact lists, including test_documents_after_rejection\
\ (lines 297-318). I read only that one and the failing test, so check the rest for the same assertion.\n\
Not verified: whether 7713ce278 was in the docsvc image these tests ran against. docsvc was redeployed\
\ 33 minutes into the run, so the image may have changed mid-run. The extra action matches the diff,\
\ so I think it was.\nProposed change: In test_document_review.py, add \"Document_Enhance\" to the expected_actions\
\ lists. That covers test_review_task_for_pi (line 263), test_documents_after_rejection (line 297) and\
\ the same lists in the other failing tests. Then re-check the PI, current-user and post-upload assertions.\
\ If Enhance should still be hidden for these documents, ask the author of #17451 (pralim) instead,\
\ and treat it as a product bug."
```
+++ Agent notes
Filed by X-ray's triage agent. Models asked: claude-sonnet-5-5; settled by deep; 9 lookups in the code and its history.
Group `triage:d76742de8fc85c` (one issue per root cause).
A wrong verdict can be corrected on the run page in X-ray.
+++