Xray
all clusters 1h 6h 24h 48h 3d 5d 7d 14d 30d ‹
Last 1 hour▾
Ends now. Anything up to this cluster's 30-day retention.
Start and end times
Cancel
Interpreted in UTC (change it at the right of this bar). Earliest available: 2026-10-24 10:02:15.
› →|
updated 5d ago
Sample data. This database was generated by scripts/seed_dev_db.py — every service, deploy, person and figure on this page is synthetic. Names are sample.*@seed.invalid and image tags are prefixed SEED-. Nothing here happened.

‹ Test triage

[Test failure] Test rule and auto-compute use operator "is" on a number question; publish now rejects it (10 tests)

The test is wrong confidence high · 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-8847 · Completed
Owner
[email protected] (the test agent opens the pull request once this is in Ready for Development)
Filed in
Backlog, Test Agent Automation
Service
studiosvc
History when filed
new, this error since build 597
Suspect commit
862429c0a studiosvc: flag rules whose compared choices no longer exist when a question's choices change (ENG-6755) (#17179) (sanchitmishra08)
Branches
fails on master; these tests are not in the production suite (api-tests-production build 620).
The setup fixture `published_configuration` (study_configuration_fixtures.py:24) gets a 400 on publish: "rule … compares a question whose category changed; its condition no longer fits". The test helper builds the rule and the auto-compute with a hard-coded operator "is" and value "5", on a number question (`condition_on`, studio_helper.py:203, used by `set_autocompute` and `add_activation_rule_chain`). Commit 862429c0a (ENG-6755, 2026-11-13) added a publish check. In graphlib `ConditionStaleness` (branch_stale.go:143), a number question only accepts the numeric operators such as "is equal to". So "is" counts as stale (reason `type`) and publish is refused. That is the intended contract, and the tests predate it by hours. They were added in 83b37c21f at 06:10, and the stale check landed at 11:57. All 10 tests use a published-configuration fixture (`published_configuration` or `completed_visits_draft`), so one root cause covers them. The mid-run deploys and the chat-agent probe are unrelated: the 400 is deterministic.

Proposed fix

In e2e/automation/utils/helpers/studio_helper.py, make `condition_on` choose the operator from the variable's datatype and textformat. For a number question use "is equal to" with a numeric value, such as "5". Keep "is" only for string or choice questions. Then publish should return 200 for the rule chain and the auto-compute.

History of this root cause

  • filed ENG-8847 · build 597 8d ago
    The test is wrong, confidence high; 10 tests; to nobody in Backlog
  • branches ENG-8847 7d ago
  • joined ENG-8847 · build 599 6d ago
    10 more failing tests tied to it

Tests 10

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.

TestHistoryNewest runReading
test_edit_published_configuration_with_existing_draft_returns_that_draft
StudioConfigurationLifecycle
did not run
test_codelist_of_locked_question_cannot_be_changed
StudioCompletedVisitLocks
did not run
test_edit_in_editor_of_published_configuration_switches_to_draft_copy
StudioConfigurationLifecycle
did not run
test_pre_existing_question_cannot_be_saved_in_apply_to_completed_visits_draft
StudioCompletedVisitLocks
did not run
test_new_question_can_be_added_in_apply_to_completed_visits_draft
StudioCompletedVisitLocks
did not run
test_rename_draft_configuration
StudioConfigurationLifecycle
did not run
test_autocompute_settings_survive_draft_from_published_configuration
StudioConfigurationLifecycle
did not run
test_edit_published_configuration_creates_listed_draft
StudioConfigurationLifecycle
did not run
test_only_new_visit_can_be_deleted_in_apply_to_completed_visits_draft
StudioCompletedVisitLocks
did not run
test_delete_draft_leaves_published_configuration_and_its_logic_intact
StudioConfigurationLifecycle
did not run

How the agent decided

Models
claude-sonnet-5-5 ($0.40, 16 lookups)
Settled by
the investigating model
Cost
$0.40

What it looked up (16, in order)

1. read_file repo=main, path=e2e/automation/tests/fixtures/studio/study_configuration_fixtures.py, start_line=1, end_line=120 · 5543 chars back
e2e/automation/tests/fixtures/studio/study_configuration_fixtures.py (132 lines), lines 1-120: 1 import logging as logger 2 3 import pytest 4 5 from automation.models.v2.studio.activity import Activities 6 from automation.models.v2.studio.forms import Forms 7 from automation.utils.helpers.studio_helper import ( 8 add_form, 9 add_question, 10 add_section, 11 add_visit, 12 create_study_configuration, 13 delete_form_if_present, 14 draft_section, 15 unique_name, 16 ) 17 18 19 @pytest.fixture(scope="class") 20 def published_configuration(test_headers): 21 config = create_study_configuration(test_headers) 22 forms = Forms(test_headers) 23 response = forms.take_action(config["protocol_id"], "publish") 24 assert response.status_code == 200, f"Publish failed: {response.status_code} — {response.text}" 25 logger.info(f"published_configuration: published {config['protocol_id']}") 26 27 yield config 28 29 delete_form_if_present(test_headers, config["protocol_id"]) 30 31 32 @pytest.fixture(scope="function") 33 def configuration_draft(test_headers, published_configuration): 34 forms = Forms(test_headers) 35 response = forms.create_draft(published_configuration["protocol_id"]) 36 assert response.status_code == 200, f"Edit failed: {response.status_code} — {response.text}" 37 draft_id = response.json()["tildaid"] 38 logger.info(f"configuration_draft: draft {draft_id} of {published_configuration['protocol_id … (4043 more characters not kept)
2. search_code repo=main, text=whose category changed · 807 chars back
studiosvc/pkg/repo/condition_stale.go 159: out = append(out, fmt.Sprintf("%s compares a question whose category changed; its condition no longer fits", owner)) studiosvc/pkg/repo/condition_stale_test.go 94: `rule "n1 rule" compares a question whose category changed; its condition no longer fits`, workplansvc/pkg/pubsub/agent_row_keep_comparison_test.go 71: t.Errorf("a row whose category changed must not inherit the warning: %+v", *incoming.WorkOrder) studiosvc/pkg/repo/condition_stale_category_integration_test.go 17: // A question whose category changed in the draft. Published P (protocol PP) and draft D (protocol DP) share every studiosvc/pkg/studio/condition_stale_publish_integration_test.go 257: want := `the auto-compute on question "Total" compares a question whose category changed`
3. read_file repo=main, path=studiosvc/pkg/repo/condition_stale.go, start_line=1, end_line=200 · 8943 chars back
studiosvc/pkg/repo/condition_stale.go (788 lines), lines 1-200: 1 package repo 2 3 import ( 4 "context" 5 "encoding/json" 6 "errors" 7 "fmt" 8 "slices" 9 "strconv" 10 "strings" 11 12 "studiosvc/pkg/model" 13 14 "github.com/tildabio/main/common/graphlib" 15 "github.com/tildabio/main/tildaobj" 16 logger "github.com/tildabio/main/util/observability" 17 "go.uber.org/zap" 18 ) 19 20 // ErrStaleConditionsNotPublishable refuses a publish whose rules or auto-computes check for choices that are gone. 21 var ErrStaleConditionsNotPublishable = errors.New("cannot be published") 22 23 // errStaleCheckTooLarge marks a global activity version too large to walk for its forms (globalActivityHostForms). 24 // It is not a reason to refuse a publish: callers skip the cross-form stale check and log it. 25 var errStaleCheckTooLarge = errors.New("too large to check its rules") 26 27 const ( 28 staleOwnerRule = "rule" 29 staleOwnerAutoCompute = "autoCompute" 30 ) 31 32 // conditionStaleRow is one condition under one owner (activation rule or auto-compute) of graphId. 33 type conditionStaleRow struct { 34 GraphId string 35 CondId string 36 CfgId string 37 Kind string 38 OwnerId string // rule id, or auto-compute config id 39 // OwnerName is the rule's BranchConfig name, or for an auto-compute the title of the question it sets. 40 OwnerName string 41 QRefId string // auto-compute only: the question ref owning the config in this graph 42 Shared bool // … (7443 more characters not kept)
4. commits repo=main, path=studiosvc/pkg/repo/condition_stale.go · 157 chars back
862429c0a 2026-11-13T11:57 sanchitmishra08: studiosvc: flag rules whose compared choices no longer exist when a question's choices change (ENG-6755) (#17179)
5. search_code repo=main, text=def create_study_configuration · 93 chars back
e2e/automation/utils/helpers/studio_helper.py 259: def create_study_configuration(headers):
6. read_file repo=main, path=e2e/automation/utils/helpers/studio_helper.py, start_line=150, end_line=340 · 8105 chars back
e2e/automation/utils/helpers/studio_helper.py (336 lines), lines 150-336: 150 payload.pop("parentmap", None) 151 question_id = _body(Questions(headers).post(payload), "create radio question")["tildaid"] 152 response_set_id = _body( 153 ResponseSets(headers).create( 154 { 155 "name": unique_name("Codelist"), 156 "variablename": "", 157 "choices": ["Yes", "No"], 158 "codes": ["Yes", "No"], 159 "protocolid": section["protocol_id"], 160 } 161 ), 162 "create codelist", 163 )["tildaid"] 164 ref = _body( 165 Graph(headers).graph_action( 166 section["questionnaire_id"], 167 node_action( 168 "add", 169 response_set_id, 170 "ResponseSet", 171 section["protocol_id"], 172 previd=previd, 173 questionid=question_id, 174 parentmap=section_parentmap(section), 175 flags=BASE_FLAGS, 176 ), 177 ), 178 "add codelist", 179 ) 180 return {"question_id": question_id, "response_set_id": response_set_id, "ref_id": ref["tildaid"]} 181 182 183 def section_variable(headers, section, ref_id): 184 variables = _body( 185 Branches(headers).get_variables(section["questionnaire_id"], section["protocol_id"]), "list variables" 186 )["variables"] 187 ret … (6605 more characters not kept)
7. commits repo=main, path=e2e/automation/utils/helpers/studio_helper.py, since=2026-11-01T00:00:00Z · 156 chars back
83b37c21f 2026-11-13T06:10 tilda-gitbot[bot]: Studio API: cover study configuration drafts, completed-visit locks and canvas block edits (ENG-8648) (#17359)
8. commits repo=main, path=studiosvc, since=2026-11-12T00:00:00Z · 1387 chars back
bea983e34 2026-11-15T01:23 nkommuri: feat(execsvc,studiosvc): auto queries apply across protocol versions (ENG-7994) (#17446) 03f9c2d6b 2026-11-13T17:58 Shashank-Agrawal12: authz: organization archive (soft delete) and purge (ENG-7837) (#17340) 3e5ce671e 2026-11-13T12:32 poojalodhi: feat(studiosvc): add GET /api/studio/activities/{id}/objectCounts (ENG-4808) (#17428) 862429c0a 2026-11-13T11:57 sanchitmishra08: studiosvc: flag rules whose compared choices no longer exist when a question's choices change (ENG-6755) (#17179) 89e9249fc 2026-11-13T05:38 susheelkumar-cmyk: studiosvc: show in-protocol and codelist edits in the Studio audit log (ENG-7019) (#17365) 9976e91e8 2026-11-12T21:44 danherberttilda: fix(studiosvc): return the statement's variable name and state in the list API (ENG-7501) (#17411) 681f8cc47 2026-11-12T21:14 sureshboddapati: studiosvc: import the protocol studioai extracts from a study's documents, on pub/sub (ENG-3080) (#17410) c300b8c51 2026-11-12T18:44 danherberttilda: fix(studiosvc): reject blank and whitespace-only variable names server-side (ENG-7694) (#17404) 9b80cb7b6 2026-11-12T06:30 arzatskis: Use camelCase for API query params and JSON fields across Go and Python services (#17334) 34641b6b8 2026-11-12T00:49 sureshboddapati: studiosvc: a protocol import takes the next free name_N instead of replacing a same-name protocol (ENG-8465) (#17376)
9. search_code repo=main, text=func ConditionStaleness · 151 chars back
common/graphlib/branch_stale.go 142: func ConditionStaleness(cond tildaobj.BranchCondition, q QuestionShape) (staleChoices []string, reason string) {
10. search_code repo=main, text=AUTOCOMPUTE_SOURCE_VALUE, path_prefix=e2e/automation · 149 chars back
e2e/automation/utils/helpers/studio_helper.py 13: AUTOCOMPUTE_SOURCE_VALUE = "5" 190: def condition_on(variable, value=AUTOCOMPUTE_SOURCE_VALUE):
11. read_file repo=main, path=common/graphlib/branch_stale.go, start_line=1, end_line=230 · 7446 chars back
common/graphlib/branch_stale.go (159 lines), lines 1-159: 1 package graphlib 2 3 import ( 4 "slices" 5 "strings" 6 7 "github.com/tildabio/main/tildaobj" 8 ) 9 10 // StaleChoices returns the entries of used that are absent from current, in 11 // used's order and de-duplicated. Matching is exact, like the runtime's 12 // apoc.coll.intersection against the answers. 13 func StaleChoices(used, current []string) []string { 14 have := make(map[string]struct{}, len(current)) 15 for _, c := range current { 16 have[c] = struct{}{} 17 } 18 var stale []string 19 seen := map[string]struct{}{} 20 for _, u := range used { 21 if _, ok := have[u]; ok { 22 continue 23 } 24 if _, ok := seen[u]; ok { 25 continue 26 } 27 seen[u] = struct{}{} 28 stale = append(stale, u) 29 } 30 return stale 31 } 32 33 // ConditionStaleChoices returns the choices cond compares against that its 34 // question's current choices no longer contain. Only the set-membership 35 // operators handled by getCondCypher's intersection branches are checked; 36 // numeric, date, age and empty-RHS ("answer missing") conditions never go stale. 37 func ConditionStaleChoices(cond tildaobj.BranchCondition, current []string) []string { 38 if len(current) == 0 { 39 return nil 40 } 41 switch cond.Operator { 42 case STUDIO_CONDITION_OPERATOR_IS, STUDIO_CONDITION_OPERATOR_IS_ON, 43 STUDIO_CONDITION_OPERATOR_IS_NOT, STUDIO_CONDITION_OPERATOR_IS_NOT_ON: 44 default: 45 return nil 46 } 47 used : … (5946 more characters not kept)
12. commits repo=main, path=common/graphlib/branch_stale.go · 157 chars back
862429c0a 2026-11-13T11:57 sanchitmishra08: studiosvc: flag rules whose compared choices no longer exist when a question's choices change (ENG-6755) (#17179)
13. search_code repo=main, text=STUDIO_CONDITION_OPERATOR_IS_EQUAL_TO = · 30 chars back
no match on the default branch
14. search_code repo=main, text="is equal to", path_prefix=e2e/automation · 30 chars back
no match on the default branch
15. search_code repo=main, text=STUDIO_CONDITION_OPERATOR_IS_EQUAL_TO, path_prefix=common/graphlib · 863 chars back
common/graphlib/model.go 85: STUDIO_CONDITION_OPERATOR_IS_EQUAL_TO = "is equal to" //@enum-replace-condition-operator common/graphlib/branch_stale.go 116: numberConditionOperators = []string{STUDIO_CONDITION_OPERATOR_IS_EQUAL_TO, STUDIO_CONDITION_OPERATOR_IS_NOT_EQUAL_TO, common/graphlib/branchConfig.go 711: STUDIO_CONDITION_OPERATOR_IS_EQUAL_TO: "=", 720: STUDIO_CONDITION_OPERATOR_IS_EQUAL_TO: "=", common/graphlib/branch_stale_test.go 85: {"number rule after change to date", cond(STUDIO_CONDITION_OPERATOR_IS_EQUAL_TO, "10"), dateQ, nil, StaleReasonType}, common/graphlib/branchConfig_subvariable_test.go 283: visitStatus := tildaobj.BranchCondition{VariableId: "cv-var", SubVariable: tildaobj.VAR_VISIT_STATUS_NAME, Operator: STUDIO_CONDITION_OPERATOR_IS_EQUAL_TO, Choices: []string{"Completed"}}
16. commit_diff repo=main, sha=862429c0a, path=studiosvc/pkg/repo/condition_stale.go · 6264 chars back
862429c0a 2026-11-13T11:57 sanchitmishra08: studiosvc: flag rules whose compared choices no longer exist when a question's choices change (ENG-6755) (#17179) 26 files changed: common/graphlib/autoComputeConfig.go, common/graphlib/branch_stale.go, common/graphlib/branch_stale_test.go, common/graphlib/model.go, studiosvc/pkg/handlers/activity.go, studiosvc/pkg/handlers/form.go, studiosvc/pkg/handlers/protocol_visit.go, studiosvc/pkg/model/model.go, studiosvc/pkg/repo/activation_rule.go, studiosvc/pkg/repo/condition_stale.go, studiosvc/pkg/repo/condition_stale_category_integration_test.go, studiosvc/pkg/repo/condition_stale_hooks_integration_test.go, studiosvc/pkg/repo/condition_stale_integration_test.go, studiosvc/pkg/repo/condition_stale_test.go, studiosvc/pkg/repo/condition_stale_validate_integration_test.go, studiosvc/pkg/repo/form.go, studiosvc/pkg/repo/graph.go, studiosvc/pkg/repo/import.go, studiosvc/pkg/repo/protocol_visit.go, studiosvc/pkg/repo/question.go, studiosvc/pkg/repo/stale_api_integration_test.go, studiosvc/pkg/studio/condition_stale_publish_integration_test.go, studiosvc/pkg/studio/form.go, studiosvc/pkg/studio/protocol_validation_error_test.go, studiosvc/pkg/studio/protocol_visit.go … --- studiosvc/pkg/repo/condition_stale.go @@ -0,0 +1,788 @@ +package repo + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "slices" + "strconv" + "strings" + + "studiosvc/pkg/model" + + "github.com/tildabio/main/common/graphlib" + "github.com/tildabio/main/tildaob … (4764 more characters not kept)

What it was shown (build 597, 29.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": 10, "suite": "StudioConfigurationLifecycle", "members": [ { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_published_configuration_creates_listed_draft", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null }, { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_in_editor_of_published_configuration_switches_to_draft_copy", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null }, { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_published_configuration_with_existing_draft_returns_that_draft", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null }, { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_rename_draft_configuration", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null }, { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_autocompute_settings_survive_draft_from_published_configuration", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null }, { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_delete_draft_leaves_published_configuration_and_its_logic_intact", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null }, { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_only_new_visit_can_be_deleted_in_apply_to_completed_visits_draft", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null }, { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_pre_existing_question_cannot_be_saved_in_apply_to_completed_visits_draft", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null }, { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_codelist_of_locked_question_cannot_be_changed", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null }, { "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_new_question_can_be_added_in_apply_to_completed_visits_draft", "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597, "failing_since_build": 597, "last_passed_build": null } ] }
The failure
{ "test": "automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_published_configuration_creates_listed_draft", "status": "error", "message": "failed on setup with \"AssertionError: Publish failed: 400 \u2014 {\"message\":\"could not publish protocol: validation failed: protocol cannot be published: rule \\\"rule_VqltpxQi\\\" compares a question whose category changed; its condition no longer fits; the auto-compute on question \\\"Test Number Question Rz1zOG\\\" compares a question whose category changed; its condition no longer fits\"}\nassert 400 == 200\n + where 400 = <Response [400]>.status_code\"", "traceback_tail": "automation/tests/fixtures/studio/study_configuration_fixtures.py:24: in published_configuration\n assert response.status_code == 200, f\"Publish failed: {response.status_code} \u2014 {response.text}\"\nE AssertionError: Publish failed: 400 \u2014 {\"message\":\"could not publish protocol: validation failed: protocol cannot be published: rule \\\"rule_VqltpxQi\\\" compares a question whose category changed; its condition no longer fits; the auto-compute on question \\\"Test Number Question Rz1zOG\\\" compares a question whose category changed; its condition no longer fits\"}\nE assert 400 == 200\nE + where 400 = <Response [400]>.status_code", "requests": [ { "trace_id": "a917e57adadeaac10566179ec73b2dda", "method": "PATCH", "path": "/api/studio/forms/eced828b-0443-46ce-8288-ca7b2f222014", "status": "400", "error": "None" }, { "trace_id": "a917e57adadeaac10566179ef96bafe3", "method": "POST", "path": "/api/studio/graph/f569d9bf-afe8-430f-8e82-1821a6ff5109/nodeAction", "status": "200", "error": "None" }, { "trace_id": "a917e57adadeaac10566179d10dedb0a", "method": "GET", "path": "/api/studio/graph/f569d9bf-afe8-430f-8e82-1821a6ff5109/variables", "status": "200", "error": "None" }, { "trace_id": "a917e57adadeaac1056617959ac3fad2", "method": "POST", "path": "/api/studio/forms/f569d9bf-afe8-430f-8e82-1821a6ff5109/activationRules", "status": "200", "error": "None" }, { "trace_id": "a917e57adadeaac105661791f05911f8", "method": "POST", "path": "/api/studio/forms/f569d9bf-afe8-430f-8e82-1821a6ff5109/activationRuleChains", "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": [ "451: INFO </ul>", "452: INFO <p>Please let me know if anything is unclear.</p>", "453: INFO <p>Best regards,</p><div class=\"email-signature-box\" style=\"margin-top:16px\"><p>Powered by AI Teammates</p></div></div> and facts=[{'key': 'communication_tone', 'value': \"Open with about two warm, specific sentences congratulating the Principal Investigator on selection for study participation ", "454: INFO _ ERROR at setup of TestStudioConfigurationLifecycle.test_edit_published_configuration_creates_listed_draft _", "455: INFO automation/tests/fixtures/studio/study_configuration_fixtures.py:24: in published_configuration", "456: INFO assert response.status_code == 200, f\"Publish failed: {response.status_code} \u2014 {response.text}\"", "457: ERROR E AssertionError: Publish failed: 400 \u2014 {\"message\":\"could not publish protocol: validation failed: protocol cannot be published: rule \\\"rule_VqltpxQi\\\" compares a question whose category changed; its condition no longer fits; the auto-compute on question \\\"Test Number Question Rz1zOG\\\" compa", "\u2026", "761: INFO assert False is not False", "762: INFO + where False = <built-in method get of dict object at 0x79cb79139480>('evidence_requires_document')", "763: INFO + where <built-in method get of dict object at 0x79cb79139480> = {'description': \"Wait for the site's written confirmation that its Local IRB/LEC has approved the amendment after the three timeline items are received.\", 'doc_id': None, 'evidence_requires_document': False, 'gate_clearance': ", "764: ERROR ERROR automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_published_configuration_creates_listed_draft - AssertionError: Publish failed: 400 \u2014 {\"message\":\"could not publish protocol: validation failed: protocol cannot be published: rule \\\"rule_VqltpxQi\\", "765: INFO + where 400 = <Response [400]>.status_code", "766: ERROR ERROR automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_in_editor_of_published_configuration_switches_to_draft_copy - AssertionError: Publish failed: 400 \u2014 {\"message\":\"could not publish protocol: validation failed: protocol cannot be published: rule \\", "767: ERROR ERROR automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_published_configuration_with_existing_draft_returns_that_draft - AssertionError: Publish failed: 400 \u2014 {\"message\":\"could not publish protocol: validation failed: protocol cannot be published: rul" ] }
The test's history
{ "pattern": "new", "meaning": "first seen failing", "newest_first": "F", "failing_in_a_row": 1, "this_error_in_a_row": 1, "this_error_since_build": 597 }
The test's source
{ "repo": "tildabio/main", "at": "03f9c2d6b", "path": "e2e/automation/tests/studiosvc/test_studio_rules.py", "from_line": 52, "failing_line": null, "code": "52 def test_edit_published_configuration_creates_listed_draft(\n53 self, test_headers, published_configuration, configuration_draft\n54 ):\n55 \"\"\"TC-STU-049: Edit on a published object creates a draft and opens it\"\"\"\n56 forms = Forms(test_headers)\n57 published_id = published_configuration[\"protocol_id\"]\n58 draft_id = configuration_draft[\"draft_id\"]\n59 assert draft_id != published_id\n60 \n61 draft = forms.get(draft_id, params={\"protocolid\": draft_id})\n62 assert draft.status_code == 200, f\"Open draft failed: {draft.status_code} \u2014 {draft.text}\"\n63 assert draft.json()[\"state\"] == \"draft\"\n64 assert draft.json()[\"type\"] == CONFIGURATION_TYPE\n65 assert draft.json()[\"name\"] == published_configuration[\"name\"]\n66 \n67 summary = forms.get(f\"{published_id}/summary\")\n68 assert summary.status_code == 200, f\"Summary failed: {summary.status_code} \u2014 {summary.text}\"\n69 assert summary.json()[\"state\"] == \"published\"\n70 assert summary.json()[\"draft\"][\"tildaid\"] == draft_id\n71 assert summary.json()[\"draft\"][\"state\"] == \"draft\"\n72 \n73 listed = listed_configurations(test_headers, published_configuration[\"name\"])\n74 published_row = next(f for f in listed if f[\"tildaid\"] == published_id)\n75 assert published_row[\"draft\"][\"tildaid\"] == draft_id\n76 \n77 def test_edit_in_editor_of_published_configuration_switches_to_draft_copy(\n78 self, test_headers, published_configuration, configuration_draft\n79 ):\n80 \"\"\"TC-STU-120: Edit in the editor of a published configuration with no draft creates a draft and switches to it\"\"\"\n81 forms = Forms(test_headers)\n82 draft_id = configuration_draft[\"draft_id\"]\n83 published_visit = published_configuration[\"visit\"][\"visit_id\"]\n84 draft_visit = configuration_draft[\"visit\"][\"visit_id\"]\n85 assert draft_visit != published_visit, \"the draft must own a copy of the visit, not share the published one\"\n86 \n87 published_name = forms.get(published_visit, params={\"protocolid\": published_configuration[\"protocol_id\"]})\n88 draft_visit_detail = forms.get(draft_visit, params={\"protocolid\": draft_id})\n89 assert draft_visit_detail.status_code == 200, f\"Draft visit failed: {draft_visit_detail.text}\"\n90 assert draft_visit_detail.json()[\"state\"] == \"draft\"\n91 assert draft_visit_detail.json()[\"name\"] == published_name.json()[\"name\"]\n92 \n93 published_nodes = read_section_nodes(test_headers, published_configuration[\"section\"])[\"graphnodes\"]\n94 draft_nodes = read_section_nodes(test_headers, configuration_draft[\"section\"])[\"graphnodes\"]\n95 assert [n[\"obj\"].get(\"questionid\") or n[\"obj\"][\"tildaid\"] for n in draft_nodes] == [\n96 n[\"obj\"].get(\"questionid\") or n[\"obj\"][\"tildaid\"] for n in published_nodes\n97 ], \"the draft's section must hold the same blocks in the same order\"\n98 \n99 def test_edit_published_configuration_with_existing_draft_returns_that_draft(\n100 self, test_headers, published_configuration, configuration_draft\n101 ):\n102 \"\"\"TC-STU-121: Edit on a published configuration that already has a draft opens that draft\"\"\"\n103 forms = Forms(test_headers)\n104 published_id = published_configuration[\"protocol_id\"]\n105 before = len(listed_configurations(test_headers, published_configuration[\"name\"]))\n106 \n107 again = forms.create_draft(published_id)\n108 assert again.status_code == 200, f\"Second edit failed: {again.status_code} \u2014 {again.text}\"\n109 assert again.json()[\"tildaid\"] == configuration_draft[\"draft_id\"], \"a second draft was created\"\n110 \n111 summary = forms.get(f\"{published_id}/summary\").json()\n112 assert summary[\"draft\"][\"tildaid\"] == configuration_draft[\"draft_id\"]\n113 assert len(listed_configurations(test_headers, published_configuration[\"name\"])) == before\n114 \n115 def test_rename_draft_configuration(self, test_headers, published_configuration, configuration_draft):\n116 \"\"\"TC-STU-125: A draft study configuration can be renamed from Settings\"\"\"\n117 forms = Forms(test_headers)\n118 draft_id = configuration_draft[\"draft_id\"]\n119 new_name = unique_name(\"Renamed\")\n120 \n121 response = forms.patch(draft_id, {\"name\": new_name})\n122 assert response.status_code == 200, f\"Rename failed: {response.status_code} \u2014 {response.text}\"" }
Commits in the window
{ "note": "no last pass and first failure are on record for these tests, so there is no window of commits to look in" }
The issue as the agent wrote it
**Fix is in:** the automation suite (e2e): the test is wrong. **What failed:** `failed on setup with "AssertionError: Publish failed: 400 — {"message":"could not publish protocol: validation failed: protocol cannot be published: rule \"rule_VqltpxQi\" compares a question whose category changed; its condition no longer ` **The test is wrong**, confidence high. Found in `api-tests-master` build 597: [run in X-ray](https://xray.tilda.pizza/tests/run/api-tests-master/597). The setup fixture `published_configuration` (study_configuration_fixtures.py:24) gets a 400 on publish: "rule … compares a question whose category changed; its condition no longer fits". The test helper builds the rule and the auto-compute with a hard-coded operator "is" and value "5", on a number question (`condition_on`, studio_helper.py:203, used by `set_autocompute` and `add_activation_rule_chain`). Commit 862429c0a (ENG-6755, 2026-11-13) added a publish check. In graphlib `ConditionStaleness` (branch_stale.go:143), a number question only accepts the numeric operators such as "is equal to". So "is" counts as stale (reason `type`) and publish is refused. That is the intended contract, and the tests predate it by hours. They were added in 83b37c21f at 06:10, and the stale check landed at 11:57. All 10 tests use a published-configuration fixture (`published_configuration` or `completed_visits_draft`), so one root cause covers them. The mid-run deploys and the chat-agent probe are unrelated: the 400 is deterministic. **Suspect commit:** [862429c0a](https://github.com/tildabio/main/commit/862429c0a92d73fcfa084ecb3819f8316ca05b0a) studiosvc: flag rules whose compared choices no longer exist when a question's choices change (ENG-6755) (#17179) (sanchitmishra08) **Service:** studiosvc **Proposed fix:** In e2e/automation/utils/helpers/studio_helper.py, make `condition_on` choose the operator from the variable's datatype and textformat. For a number question use "is equal to" with a numeric value, such as "5". Keep "is" only for string or choice questions. Then publish should return 200 for the rule chain and the auto-compute. **Failing tests (10):** - [automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_published_configuration_creates_listed_draft](https://xray.tilda.pizza/tests/case/ae1dea10f9b1e910) (first time seen) - [automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_in_editor_of_published_configuration_switches_to_draft_copy](https://xray.tilda.pizza/tests/case/2bb66eecddb7f0c8) (first time seen) - [automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_published_configuration_with_existing_draft_returns_that_draft](https://xray.tilda.pizza/tests/case/005b9eba02a95126) (first time seen) - [automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_rename_draft_configuration](https://xray.tilda.pizza/tests/case/85dc3f42ad0dddda) (first time seen) - [automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_autocompute_settings_survive_draft_from_published_configuration](https://xray.tilda.pizza/tests/case/9a76b71ad56aaed6) (first time seen) - [automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_delete_draft_leaves_published_configuration_and_its_logic_intact](https://xray.tilda.pizza/tests/case/e4d8cbccf40d8a2c) (first time seen) - [automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_only_new_visit_can_be_deleted_in_apply_to_completed_visits_draft](https://xray.tilda.pizza/tests/case/bde036af661f4ae2) (first time seen) - [automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_pre_existing_question_cannot_be_saved_in_apply_to_completed_visits_draft](https://xray.tilda.pizza/tests/case/6986dc65053be870) (first time seen) - [automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_codelist_of_locked_question_cannot_be_changed](https://xray.tilda.pizza/tests/case/098f8534e9c5f6b0) (first time seen) - [automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_new_question_can_be_added_in_apply_to_completed_visits_draft](https://xray.tilda.pizza/tests/case/6a83b787c60597f5) (first time seen) **Error:** ``` failed on setup with "AssertionError: Publish failed: 400 — {"message":"could not publish protocol: validation failed: protocol cannot be published: rule \"rule_VqltpxQi\" compares a question whose category changed; its condition no longer fits; the auto-compute on question \"Test Number Question Rz1zOG\" compares a question whose category changed; its condition no longer fits"} assert 400 == 200 + where 400 = <Response [400]>.status_code" ``` The test agent picks this ticket up and opens the pull request. ```yaml suite: api feature: fix-test-studio-rules find: true fix: true target_file: e2e/automation/tests/studiosvc/test_studio_rules.py failing_tests: - automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_published_configuration_creates_listed_draft - automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_in_editor_of_published_configuration_switches_to_draft_copy - automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_edit_published_configuration_with_existing_draft_returns_that_draft - automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_rename_draft_configuration - automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_autocompute_settings_survive_draft_from_published_configuration - automation/tests/studiosvc/test_studio_rules.py::TestStudioConfigurationLifecycle::test_delete_draft_leaves_published_configuration_and_its_logic_intact - automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_only_new_visit_can_be_deleted_in_apply_to_completed_visits_draft - automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_pre_existing_question_cannot_be_saved_in_apply_to_completed_visits_draft - automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_codelist_of_locked_question_cannot_be_changed - automation/tests/studiosvc/test_studio_rules.py::TestStudioCompletedVisitLocks::test_new_question_can_be_added_in_apply_to_completed_visits_draft 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: failed on setup with\ \ \"AssertionError: Publish failed: 400 \u2014 {\"message\":\"could not publish protocol: validation\ \ failed: protocol cannot be published: rule \\\"rule_VqltpxQi\\\" compares a question whose category\ \ changed; its condition no longer fits; the auto-compute on question \\\"Test Number Question Rz1zOG\\\ \" compares a question whose category changed; its condition no longer fits\"}\nassert 400 == 200\n\n\ Diagnosis: The setup fixture `published_configuration` (study_configuration_fixtures.py:24) gets a 400\ \ on publish: \"rule \u2026 compares a question whose category changed; its condition no longer fits\"\ .\nThe test helper builds the rule and the auto-compute with a hard-coded operator \"is\" and value\ \ \"5\", on a number question (`condition_on`, studio_helper.py:203, used by `set_autocompute` and `add_activation_rule_chain`).\n\ Commit 862429c0a (ENG-6755, 2026-11-13) added a publish check. In graphlib `ConditionStaleness` (branch_stale.go:143),\ \ a number question only accepts the numeric operators such as \"is equal to\". So \"is\" counts as\ \ stale (reason `type`) and publish is refused.\nThat is the intended contract, and the tests predate\ \ it by hours. They were added in 83b37c21f at 06:10, and the stale check landed at 11:57.\nAll 10 tests\ \ use a published-configuration fixture (`published_configuration` or `completed_visits_draft`), so\ \ one root cause covers them. The mid-run deploys and the chat-agent probe are unrelated: the 400 is\ \ deterministic.\nProposed change: In e2e/automation/utils/helpers/studio_helper.py, make `condition_on`\ \ choose the operator from the variable's datatype and textformat. For a number question use \"is equal\ \ to\" with a numeric value, such as \"5\". Keep \"is\" only for string or choice questions. Then publish\ \ should return 200 for the rule chain and the auto-compute." ``` +++ Agent notes Filed by X-ray's triage agent. Models asked: claude-sonnet-5-5; settled by deep; 16 lookups in the code and its history. Group `triage:c9dd0f82b3a40b` (one issue per root cause). A wrong verdict can be corrected on the run page in X-ray. +++