Repository navigation
fix(backend): default MEMORY_MODE=write so memory intake is on - #11584
Conversation
Post-unification, off pauses all writes. Keep that as an explicit kill switch, not the deploy default. Failure-Class: none
There was a problem hiding this comment.
1 issue found across 9 files
Confidence score: 5/5
- In
backend/tests/unit/test_backend_runtime_env_validator.py, assertingerrors == []against the livedeploy/runtime_env.yamlprod section makes the test depend on manifest content drift instead of validator behavior, which can cause flaky or misleading failures as config changes; decouple it by using a fixed fixture or mocking the prod input and asserting specific validation outcomes.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/tests/unit/test_backend_runtime_env_validator.py">
<violation number="1" location="backend/tests/unit/test_backend_runtime_env_validator.py:1949">
P3: The new test asserts `errors == []` against the real `deploy/runtime_env.yaml` prod section, so its pass/fail is coupled to whatever the current prod manifest happens to contain rather than to the validator's decision logic. Every other contract test in this file (e.g. `test_memory_maintenance_job_contract_rejects_read_mode_without_job_cron`) builds a controlled scenario via `tmp_path` and `write_yaml`. When prod legitimately moves to `read` at the Gate 3 cutover, this test fails for a correct validator, and right now it does not actually isolate the behavior its name claims ("allows write without job cron") — it only smoke-tests current prod state. Build a tmp_path scenario instead.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| assert any('requires memory-maintenance-job' in message for message in messages) | ||
|
|
||
|
|
||
| def test_memory_maintenance_job_contract_allows_write_without_job_cron(): |
There was a problem hiding this comment.
P3: The new test asserts errors == [] against the real deploy/runtime_env.yaml prod section, so its pass/fail is coupled to whatever the current prod manifest happens to contain rather than to the validator's decision logic. Every other contract test in this file (e.g. test_memory_maintenance_job_contract_rejects_read_mode_without_job_cron) builds a controlled scenario via tmp_path and write_yaml. When prod legitimately moves to read at the Gate 3 cutover, this test fails for a correct validator, and right now it does not actually isolate the behavior its name claims ("allows write without job cron") — it only smoke-tests current prod state. Build a tmp_path scenario instead.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/tests/unit/test_backend_runtime_env_validator.py, line 1949:
<comment>The new test asserts `errors == []` against the real `deploy/runtime_env.yaml` prod section, so its pass/fail is coupled to whatever the current prod manifest happens to contain rather than to the validator's decision logic. Every other contract test in this file (e.g. `test_memory_maintenance_job_contract_rejects_read_mode_without_job_cron`) builds a controlled scenario via `tmp_path` and `write_yaml`. When prod legitimately moves to `read` at the Gate 3 cutover, this test fails for a correct validator, and right now it does not actually isolate the behavior its name claims ("allows write without job cron") — it only smoke-tests current prod state. Build a tmp_path scenario instead.</comment>
<file context>
@@ -1946,6 +1946,15 @@ def test_memory_maintenance_job_contract_rejects_read_mode_without_job_cron(tmp_
assert any('requires memory-maintenance-job' in message for message in messages)
+def test_memory_maintenance_job_contract_allows_write_without_job_cron():
+ validator = load_validator()
+ errors = validator._validate_memory_maintenance_job_contract(
</file context>
Summary
After #11447,
MEMORY_MODE=offis a fleet write pause (503 Memory writes are globally paused). Source still pinnedoffas a Gate 3 dark-deploy leftover, so every auto-deploy re-pauses intake.Pin default-on intake as
MEMORY_MODE=writefor every UID (no allowlist). ST→LTread+ maintenance cron stay a separate Gate 3 cutover.Failure-Class
Failure-Class: none
Test plan
validate-backend-runtime-env.py --env devand--env prodMEMORY_MODE=write/v3/memoriesis notMemory writes are globally paused