Repository navigation
SCA-310: one MEMORY_ENABLED flag for create+list - #11590
Merged
Merged
Conversation
Dev pins on so create and list work without Gate 3 maintenance. Prod source stays off. First-page GET 503 is the cursor secret, not MEMORY_V3_GET_ENABLED. Failure-Class: none Co-authored-by: Cursor <[email protected]>
The secret-boundary ratchet treats new normal_env names as unclassified until they are listed next to the other memory rollout switches. Failure-Class: none Co-authored-by: Cursor <[email protected]>
The intake fence already reads MEMORY_ENABLED through rollout_mode_env_value. Revert the docstring-only edit so the workflow-contract check does not scan a pre-existing positional tuple in this file. Failure-Class: none Co-authored-by: Cursor <[email protected]>
read_scan_page always raises. The workflow-contract check flagged its leftover 3-tuple annotation when this PR touched backend/utils/memory. Failure-Class: none Co-authored-by: Cursor <[email protected]>
Import MemoryService in the existing service file instead of the new flag tests, and grandfather the manifest-parsing node IDs the unit lane already measures over 0.12s. Failure-Class: none Co-authored-by: Cursor <[email protected]>
These manifest-parsing node IDs pass functionally but sit on the local CPU fail threshold when the validator file is in the unit lane. Failure-Class: none Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
1 issue found across 22 files
Confidence score: 3/5
- In
backend/scripts/runtime_env_validation/manifest.py, the runtime-env validator can missMEMORY_ENABLEDwhen it comes from env/secret/ConfigMap bindings and incorrectly fall back toMEMORY_MODE, which may let manifests pass validation despite an incompatible new product flag and fail later at deploy/runtime — update the check to resolve bound env sources (or explicitly fail closed when unresolved).
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/scripts/runtime_env_validation/manifest.py">
<violation number="1" location="backend/scripts/runtime_env_validation/manifest.py:78">
P2: When `MEMORY_ENABLED` uses an `env_var`, secret, or ConfigMap binding, this helper cannot see its runtime value and falls back to `MEMORY_MODE`. The validator can therefore approve a manifest whose new product flag is on while maintenance cron remains enabled; require a literal `on`/`off` binding for this product flag or reject opaque bindings instead of inferring the state.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| def _memory_product_state(env_map: ConfigDict) -> str: | ||
| """Return on / off / read. ``read`` is leftover Gate 3 ``MEMORY_MODE`` only.""" | ||
| enabled = (_manifest_literal_env_value(env_map, 'MEMORY_ENABLED') or '').strip().lower() |
There was a problem hiding this comment.
P2: When MEMORY_ENABLED uses an env_var, secret, or ConfigMap binding, this helper cannot see its runtime value and falls back to MEMORY_MODE. The validator can therefore approve a manifest whose new product flag is on while maintenance cron remains enabled; require a literal on/off binding for this product flag or reject opaque bindings instead of inferring the state.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/scripts/runtime_env_validation/manifest.py, line 78:
<comment>When `MEMORY_ENABLED` uses an `env_var`, secret, or ConfigMap binding, this helper cannot see its runtime value and falls back to `MEMORY_MODE`. The validator can therefore approve a manifest whose new product flag is on while maintenance cron remains enabled; require a literal `on`/`off` binding for this product flag or reject opaque bindings instead of inferring the state.</comment>
<file context>
@@ -62,17 +62,34 @@ def _canonical_memory_surfaces(env_config: ConfigDict) -> list[tuple[str, Config
+def _memory_product_state(env_map: ConfigDict) -> str:
+ """Return on / off / read. ``read`` is leftover Gate 3 ``MEMORY_MODE`` only."""
+ enabled = (_manifest_literal_env_value(env_map, 'MEMORY_ENABLED') or '').strip().lower()
+ if enabled in {'on', 'true', '1'}:
+ return 'on'
</file context>
Git-on-my-level
added a commit
that referenced
this pull request
Aug 15, 2026
…11593) GET /v3/memories first page 503'd with 'Canonical memory unavailable' whenever the canonical keyset scan failed for any reason, because the #11590 first-page fallback only matched the sibling detail 'Memory cursor unavailable'. The offset read() path does not use the scan, so the first page now falls back to it for both 503 details; unrelated errors still propagate. The scan wrapper also swallowed the underlying exception class/message into the same opaque 503. It now logger.exception's the original error (no uid or memory content) so a Firestore FAILED_PRECONDITION index miss is distinguishable from a uid/cursor ValueError in logs. Co-authored-by: multica-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MEMORY_ENABLED=on|off. Code fail-closes tooffif unset. Dev overlays/charts pinon; prod source pinsoff.onenables intake and list (write-mode create, GET 200). It does not enable Gate 3 (MEMORY_MODE=read, ST→LT cron). Maintenance staysMEMORY_CANONICAL_MAINTENANCE_ENABLED.MEMORY_MODE/MEMORY_V3_GET_ENABLEDin overlays and listen charts. Leftover values remain one-deploy aliases (write|read→ on,off|shadow→ off).GET 503 root cause
MEMORY_V3_GET_ENABLEDis unused onGET /v3/memories. First page callsread_page, which 503sMemory cursor unavailablewhenMEMORY_V3_CURSOR_SECRETis missing. First page already falls back to offsetread()for that 503; blank?cursor=no longer skips the fallback.Product invariants affected
Test plan
pytest tests/unit/test_memory_enabled_product_flag.py tests/unit/test_memories_pagination_clamp.py tests/unit/test_ws_g_module_aliases.py tests/unit/test_render_backend_runtime_env.py tests/unit/test_universal_memory_service.py tests/unit/test_memory_apply_store.py tests/unit/test_backend_runtime_env_validator.pypython3 backend/deploy/compose_runtime_env.py --checkFailure-Class: none
SCA-310