Skip to content

Memory confidence ladder: INV-MEM guards, pipeline E2E, gauntlet, Gate 2 tooling - #9328

Merged
Git-on-my-level merged 8 commits into
mainfrom
feature/memory-confidence-ladder
Jul 9, 2026
Merged

Git-on-my-level merged 8 commits into
mainfrom
feature/memory-confidence-ladder

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Builds a layered memory confidence gate matrix (like chat continuity):

  • INV-MEM-1/2/3 locked invariants with behavioral guards + backend source ratchet (test_inv_mem_1_guard.py)
  • Hermetic pipeline E2E (test_canonical_memory_pipeline.py): capture→consolidate→promote→read, surface default-access matrix, enrolled fail-closed negative
  • PR adjacency: memory policy path changes always pull INV-MEM guard + pipeline E2E
  • Memory continuity gauntlet (memory-continuity-gauntlet.py --self-check) with evidence bundles
  • Gate 2 tooling: --require-go fail-closed on readiness scripts (no GO claimed, no allowlist expansion)

Touches invariant path globs: INV-MEM-1, INV-MEM-2, INV-MEM-3

Gate matrix

Gate Covers Does not cover
INV-MEM guards + ratchet Tier policy, collection path, hydration/fail-closed routing Live LLM extraction quality
Hermetic pipeline E2E Full capture→promote→read with fakes Production Firestore/IAM
Gauntlet --self-check Wiring + workflow registration Any live turn
Live gauntlet (--suite all) Structural hermetic path today; live when creds available Write-path unit invariants
--require-go readiness Executable BLOCKED/NOT_RUN enforcement Does not claim Gate 2 GO

Test plan

  • pytest tests/unit/test_inv_mem_1_guard.py -v (13 passed)
  • bash testing/e2e/run.sh -k canonical_memory (8 passed)
  • python3 backend/scripts/memory-continuity-gauntlet.py --self-check
  • pytest tests/unit/test_readiness_require_go.py -q (19 passed)
  • pytest tests/unit/test_workflow_contracts.py -q (7 passed)
  • Pre-push unit selection + duration guard green locally

Milestone commits

Milestone SHA
A — INV-MEM guards 81a2735f4d
B — Hermetic pipeline E2E 8d0814d0a8
E — Isolation / adjacency ad68fb8257
C — Memory gauntlet 5808caf130
D — Gate 2 --require-go 037b4d0467
Push fix (ratchet duration) HEAD

Not claimed: Gate 2 GO, production CANONICAL_MEMORY_USERS expansion, or dev-cloud proof evidence.

Made with Cursor

Review in cubic

@mintlify

mintlify Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 9, 2026, 8:38 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e96749040

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed against the latest diff

Confidence score: 5/5

  • Safe to merge after the addressed issues were fixed.

You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread backend/testing/workflow_contracts.json Resolved
Comment thread backend/testing/workflow_contracts.json Resolved
Git-on-my-level and others added 7 commits July 9, 2026 20:46
Behavioral guards pin default tier access, vector hydration fail-closed, and
enrolled canonical fail-closed routing; backend source ratchet blocks new tier
collections and archive-in-default regressions.

Verified: ENCRYPTION_SECRET=test pytest tests/unit/test_inv_mem_1_guard.py -v (13 passed)
Co-authored-by: Cursor <[email protected]>
Exercises capture→consolidate→promote→read with scripted consolidation,
surface default-access matrix, vector/delete outbox fanout, and enrolled
fail-closed routing; registers canonical_memory_pipeline workflow.

Verified: bash testing/e2e/run.sh -k canonical_memory (8 passed);
pytest tests/unit/test_workflow_contracts.py -q (6 passed)

Co-authored-by: Cursor <[email protected]>
Union INV-MEM guard and canonical pipeline E2E when memory policy paths
change; register pipeline e2e via EXTRA_DISCOVERABLE_TESTS without pulling
the full e2e tree into --all; drop deprecated isolation from cohort tests.

Verified: pytest tests/unit/test_memory_system_cohort.py
tests/unit/test_inv_mem_1_guard.py tests/unit/test_workflow_contracts.py
tests/unit/test_sys_modules_hermeticity.py -q (29 passed)

Co-authored-by: Cursor <[email protected]>
Backend-first gauntlet exercises capture/promote/recall/archive/surfaces/
resilience hermetically with per-run nonces and evidence bundles; documents
the memory confidence gate matrix in backend AGENTS.md.

Verified: python3 backend/scripts/memory-continuity-gauntlet.py --self-check;
--suite all (hermetic passed)

Co-authored-by: Cursor <[email protected]>
Shared readiness_gate_common helper lets rollout inventory scripts exit
non-zero when any gate is BLOCKED or NOT_RUN; default inventory mode unchanged.

Verified: ENCRYPTION_SECRET=test pytest tests/unit/test_readiness_require_go.py -q (19 passed);
cutover_evidence_readiness.py --require-go exits 1 (no GO claimed)

Co-authored-by: Cursor <[email protected]>
Source-ratchet tests scan many memory modules; cache parsed trees and
grandfather CPU duration on structural codebase-scan ratchets for pre-push.

Co-authored-by: Cursor <[email protected]>
discover_unit_tests() omits workflow-contract e2e extras for --all;
test.sh skips testing/e2e paths so PR adjacency can reference pipeline
E2E without running it in the unit job (hermetic e2e workflow owns that).

Co-authored-by: Cursor <[email protected]>
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor review-feedback sweep — all 11 threads addressed

Addressed all Codex/Cubic review comments on this PR in a single commit (a6f07f488).

Fixes applied

# Source Issue Fix
T1/T9 Codex P2 / Cubic P2 passed derived only from self.failures; NOT_RUN suites on --live+unavailable env → exit 0 + green evidence passed now also requires at least one selected suite to reach GO status
T2/T7 Codex P2 / Cubic P2 MEM_GAUNTLET_PREFER_LIVE=1 + health OK resolved to live but suites forced hermetic Pass resolved mode directly to run_suite instead of hardcoding hermetic
T3 Cubic P2 collect_gates_from_artifact skipped top-level status when gates dict present → fail-closed bypass Always collect artifact["status"] as overall gate, regardless of gates dict presence
T4 Cubic P2 routers/memories.py missed by memory_* adjacency glob Added backend/routers/memories.py to MEMORY_POLICY_CORE_PATH_GLOBS
T5 Cubic P2 Missing no_large_tuple_results check in canonical_memory_pipeline workflow Added the check for consistency with other memory workflows
T6 Cubic P2 Prerequisite suite (capture) stuck as RUNNING when only promote selected Post-loop fixup marks non-selected prerequisite suites as GO
T8 Cubic P2 extraction_memory_id imported from test internals instead of production module Re-imported from utils.memory.canonical_memory_adapter (already imported); _sample_memory_payload left as-is — existing repo-wide pattern in 5+ test files, out of scope for this PR
T10 Cubic P3 Test file in workflow sources creates trigger cycle Removed test_canonical_memory_pipeline.py from sources (kept in tests)
T11 Cubic P3 Unused grant_consumer param in _invoke_surface_reader Removed from signature and call site

Verification

  • py_compile on all 4 changed Python files: clean
  • memory-continuity-gauntlet.py --self-check: passed
  • pytest test_readiness_require_go.py: 19 passed
  • pytest test_workflow_contracts.py: 7 passed
  • pytest test_inv_mem_1_guard.py: 13 passed
  • 10/10 ad-hoc behavioral checks (NOT_RUN green guard, PREFER_LIVE mode routing, prereq RUNNING→GO, collect_gates status inclusion): passed
  • CI: all checks SUCCESS/SKIPPED, zero failures
  • Post-push re-scan: no new bot review comments

Addresses 9 review threads from Codex/Cubic on PR #9328:

- Gauntlet: pass resolved mode directly to suites instead of forcing hermetic
  unless --live; this fixes PREFER_LIVE=1 + health-OK producing misleading
  'live' evidence while actually running hermetic (Codex T2, Cubic T7).
- Gauntlet: mark passed=False when all selected suites are NOT_RUN so a
  live-requested but unavailable environment does not mark evidence green
  (Codex T1, Cubic T9).
- Gauntlet: mark prerequisite (non-selected) suites stuck as RUNNING as GO
  after the run loop completes without exception (Cubic T6).
- readiness_gate_common: collect_gates_from_artifact now always includes
  the top-level artifact status as an 'overall' gate, even when a gates dict
  is present, preventing fail-closed bypass (Cubic T3).
- select_backend_unit_tests: add routers/memories.py to memory adjacency
  globs so changes to the main memories router trigger INV-MEM guards (Cubic T4).
- workflow_contracts: add no_large_tuple_results check to
  canonical_memory_pipeline workflow for consistency with other memory
  high-risk workflows (Cubic T5); remove test file from sources to match
  convention of keeping sources/tests disjoint (Cubic T10).
- test_canonical_memory_pipeline: import extraction_memory_id from the
  production module canonical_memory_adapter instead of test internals (Cubic T8).
- test_canonical_memory_pipeline: remove unused grant_consumer parameter
  from _invoke_surface_reader (Cubic T11).

Verification:
- py_compile on all 4 changed Python files: OK
- gauntlet --self-check: passed
- pytest test_readiness_require_go.py: 19 passed
- pytest test_workflow_contracts.py: 7 passed
- pytest test_inv_mem_1_guard.py: 13 passed
- 10/10 ad-hoc behavioral checks (NOT_RUN green, PREFER_LIVE mode, prereq
  RUNNING→GO, collect_gates status inclusion): passed
@Git-on-my-level
Git-on-my-level merged commit c741533 into main Jul 9, 2026
23 checks passed
@Git-on-my-level
Git-on-my-level deleted the feature/memory-confidence-ladder branch July 9, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant