Skip to content

Enable memory currency, evidence weighting, and history across Beta - #13953

Merged
Git-on-my-level merged 38 commits into
mainfrom
codex/memory-forgetting-beta
Sep 15, 2026
Merged

Git-on-my-level merged 38 commits into
mainfrom
codex/memory-forgetting-beta

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Memory capture currently mixes temporary activity with durable facts, loses source authority across adapters, and presents dated records without a consistent way to inspect history or control future use. This change makes currentness a read-side weight and carries the same memory contract through the backend, macOS, Flutter, web, and Windows.

  • Default to Useful now, with explicit History and All views, unknown classification labels, original evidence dates, and bounded cursor traversal. Retained history remains subject to the existing privacy and Archive access rules.
  • Preserve original capture time, lineage, and speaker/author attribution. Repeated captures and assistant summaries cannot manufacture corroboration, and weaker evidence cannot overwrite stronger owner statements. Saved temporary claims may age without deleting the record.
  • Keep truth review separate from suppress, allow, and useful feedback. Record use feedback and canonical mutations atomically with retry receipts, revision checks, and source/account fences.
  • Improve scoped claim/decision extraction and synthesis; provide bounded resumable classification-only enrichment. An automation pause stops those writes while preserving temporal reads and preventing clock-only archival.

Beta configuration enables the contract for all eligible users across every supported first-party surface, without a per-account cohort. The development backend and jobs enable belief/synthesis; macOS Beta, Flutter Beta, web development, and Windows Beta route to that environment. Production remains disabled. This PR does not deploy, distribute clients, run customer-data enrichment, or authorize general release.

Validation:

  • OMI_PR_BODY_FILE=<body> make preflight: all 66 required checks and the full normal pre-push gate passed on head a2916692d8, including backend typecheck/tests, OpenAPI/generated clients, Flutter localization and macOS debug build; focused CI regressions are additionally verified below.

  • Backend: repository file-isolated suites cover evidence admission/transactions, feedback replay and rollback, truth review, classification/resume, temporal list/search, privacy, JIT/profile, routing and safe pause. Full backend Pyright reports zero errors; final access/search suites pass 60 tests.

  • macOS: debug Swift build passed; final layer/API tests pass 35 cases, including capability discovery, cursor restart, and inactive-history controls. The earlier decoder/projection suite also passed.

  • Flutter: 48 focused tests and the analyzer ratchet pass on pinned Flutter 3.44.5, covering temporal decoding, owner/backend cache scope, server views, cursor continuation, and feedback. Generated localization covers all 49 supported locales and the dependency lock remains unchanged.

  • Web: full Vitest suite (472 tests), final focused suite (26 tests), and typecheck passed. A localhost browser run with mocked Firebase/API exercised Useful now, History continuation, All, and suppress/refresh; additional regression coverage checks account/backend isolation and feedback retry behavior.

  • Windows: full Vitest passed 5,560 tests (33 skipped), 42 focused tests passed, and lint (zero errors) and typecheck passed. Coverage includes evidence/assessment dates, inactive-history actions, capability downgrade, owner switching, and retry IDs.

  • CI follow-up regressions: desktop workflow/manifest contracts 139 passed; generated schema contracts 16 passed; isolated tool router 103 passed; evidence reprocess 8 passed plus immutable identity regression; archive-access source guard 14 passed. No evidence identity or archive-access policy was relaxed.

  • Runtime manifest composition, dev/prod validation, first-party Beta routing, CORS/proxy contracts, and public OpenAPI checks passed. App-client and integration contracts and all generated clients were regenerated.

  • Updated the existing pinned formatter for Bun lockfiles, registered the new route/config policies, and distinguished canonical review/tier metadata from legacy lifecycle mechanisms in the migration inventory. Regression guards remain enforced.

Release qualification still needs native Windows execution, installed-client/live serving receipts, a healthy bounded maintenance run, and a separately authorized data-enrichment plan if desired. These are not claimed by local tests or Beta configuration.

Product invariants affected

  • INV-DATA-1: keep fixed Beta serving endpoints and the existing production Firebase identity/data plane; Stable remains production-routed.
  • INV-MEM-1: retain three storage tiers; temporal history does not grant Archive access.
  • INV-MEM-3: canonical state and access fences remain authoritative; no historical recovery around failed canonical/provider checks.
  • INV-MEM-4: existing canonical mutation/promotion authority owns every write and retry.
  • INV-TASK-2: decision-state synthesis does not create or resolve action items.

The accepted behavior and operational boundary are documented in backend/docs/memory/belief_model_plan.md and docs/doc/developer/memory-clients.mdx.

Failure class (fixes)

Failure-Class: none

The formatter repair adds support for the repository's Bun lockfile to the existing pinned-toolchain primitive. It preserves mismatch rejection and does not change the separate dev-harness PATH-resolution contract.

File size exceptions

Line-Count-Exception: backend/database/memory_apply_store.py | 2885 -> 3390 | Keep feedback receipts and canonical mutation in the existing atomic transaction owner.
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3047 -> 3101 | Preserve attribution and original evidence time at the existing conversation ingestion boundary.
Line-Count-Exception: backend/utils/memory/canonical_memory_adapter.py | 3773 -> 4085 | Keep evidence admission and historical access in the canonical adapter; pure policies are extracted into separate modules.
Line-Count-Exception: backend/utils/memory/daily_memory_sweep.py | 5605 -> 5631 | Apply Beta eligibility and automation pause in the existing sweep lifecycle.
Line-Count-Exception: backend/utils/memory/memory_service.py | 4063 -> 4310 | Extend existing read ownership with bounded temporal traversal and shared privacy policies.
Line-Count-Exception: desktop/macos/Desktop/Sources/MainWindow/Pages/MemoriesPage.swift | 3701 -> 4048 | Keep temporal views, capability and feedback state within the current account-scoped memory page owner.
Line-Count-Exception: desktop/macos/Desktop/Sources/Services/APIClient/APIClient+Memories.swift | 1399 -> 1595 | Keep temporal wire metadata and retry handling in the existing memory API boundary.

Closes SCA-477.

@mintlify

mintlify Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

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

Project Status Preview Updated
omi 🟢 Ready View Preview Sep 15, 2026, 7:42 AM

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

@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.

All reported issues were addressed across 244 files

You’re at about 97% 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].

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.

Re-trigger cubic

Comment thread backend/desktop_backend.py Resolved
Comment thread backend/routers/memories.py Resolved
Comment thread web/app/src/hooks/useMemories.ts Resolved
Comment thread backend/utils/memory/belief_backfill.py Resolved
Comment thread backend/utils/memory/belief_backfill.py Resolved
Git-on-my-level and others added 12 commits September 15, 2026 06:42
The dev pusher runtime contract already registers
MEMORY_BELIEF_AUTOMATION_PAUSED='false' (and the prod counterpart), and
the rendered deployment binds it consistently; the pinned literal
snapshot in test_verify_pusher_config_references.py was not updated.

Also grandfather the render+deepcopy-heavy literal-policy test in the
duration allowlist next to its siblings from the same file.
POST /v3/memories/{id}/use is registered on desktop-backend, whose memory
items live in the configured customer data plane (OMI_FIRESTORE_DATA_PLANE_
PROJECT is mandatory there). The route handed the compute Firestore client
to the canonical mutation adapter, so valid feedback could report missing
memories or mutate the wrong project. Follow the jit_ledger_snapshot /
jit_rollout precedent and resolve get_data_plane_firestore_client() at
request time; pin the seam with a route contract test.
…inel

read_ledger_history_page set next_start_after to the sentinel row itself:
the next keyset page started strictly after it, so the row at the sentinel
position was permanently skipped whenever it was an eligible history row.
Stop the scan at the sentinel and keep the continuation key on the last
row considered for emission, so the next page rescans the sentinel row.
Covers search_ledger_history_page, which pages over the same provider.
Four correctness fixes from PR review triage:

- _default_item_reader passed a bare string id as the Firestore __name__
  cursor; every real resume failed at query build. Build the
  DocumentReference like every sibling scanner (review_queue et al).
- Checkpoint completed[] entries were terminal without comparing the
  stored revision: an owner-edited unknown/skipped row was never
  reclassified. Invalidate stale entries so reruns reclassify them.
- A dry-run --checkpoint preview cached classifications but advanced the
  cursor past the page, so the later --apply run stranded the cache
  forever. Record each cached entry's page-start read cursor and have an
  apply run re-read the earliest cached-but-unapplied page; dry-run
  cursor advance (past unreadable rows) is unchanged.
- eligible_record admitted pending/blocked processing states into belief
  corroboration; require processing_state == processed, mirroring the
  canonical read fence.
Six fixes from PR review triage, each with a focused test:

- Offset fallback for temporal views post-filtered one already-paged
  released window, dropping history rows and underfilling pages; pass
  view/as_of into MemoryService.read so admission precedes slicing.
- The use-feedback route leaked 500s for MemoryFirestoreApplyError and
  CanonicalMemoryIntakePausedError (not RuntimeError subclasses); map
  intake pause to 503 and apply-store fences to 409 like jit_rollout.
- The retrieval tool's temporal loop dropped page.truncated when a
  budget-truncated page had no continuation cursor and reported a
  partial scan as complete; propagate truncation and stop.
- A non-string arguments.decision from the model raised TypeError in
  set membership and discarded the whole observation batch; drop it
  like any invalid decision instead.
- The daily-sweep add path omitted candidate arguments from its
  LedgerWrite, losing proposed decisions and scoped qualifiers; pass
  them through like the amend path.
- Canonical conversation capture dropped candidate predicate/arguments;
  carry them onto the persisted Memory.
Four review-verified fixes in the memories Beta surfaces:

- The canonical refresh is now single-flight: a use-feedback commit fires
  the cache-invalidation listener synchronously (before its caller
  resumes), which used to steal the fetch lock and make refresh(true)
  report failure after a successful server commit. Concurrent callers
  now join the in-flight refresh, and the invalidation effect reuses
  refresh() instead of a duplicate loader.
- A view/category change that arrived while any fetch was in flight was
  consumed by prevQueryRef and then dropped by the fetchingRef guard,
  permanently keeping the previous view's rows. The query is consumed
  only when the fetch starts, re-armed via fetchIdleTick when a fetch
  goes idle, and responses are fenced by query as well as scope so a
  stale page can never land on a new view.
- The memories prefetcher bails out after each await when the owner
  scope changed mid-flight, so one owner's response can no longer be
  cached under the other's IndexedDB scope.
- The prefetch effect depends on the stable scopeKey primitive instead
  of the per-render scope object, so a rerender inside the two-second
  delay no longer cancels the owner's prefetch permanently.
…semantics, l10n

- A deleted legacy/cached row without an assessment timestamp returned
  isUsefulNow=true and could surface in the useful-now collection; gate
  the unassessed branch on !deleted.
- Two rapid taps on Show-more both fetched the same offset page and each
  advanced _ledgerHistoryOffset, skipping the next history page; add the
  single-flight guard mirroring _inFlightLoad.
- The history banner's unconditional excludeSemantics hid the new
  load-more button from screen readers; exclude only when there is no
  action so the button stays reachable (label merges into the banner).
- Translate memoryHistory in all 48 non-English ARBs (Arabic السجل
  matching memoryHistoryPartial terminology) and the generated
  localizations.
…mo fixes

- The bulk pager treated a budget-truncated cursor page (no continuation)
  as normal completion, silently exporting/purging a partial set; detect
  X-Omi-List-Truncated on the break paths and fail loudly. Offset-mode
  recovery by rows-received still resolves.
- hydrateFromDisk skipped the loaded reset when the cache list was
  already null, so the revalidation effect never fetched the new view;
  reset whenever the view differs and sync hook state on view change so
  stale rows drop immediately (and stay cleared on fetch failure).
- The open detail sheet kept the stale suppression label after a
  successful allow/suppress; patch detailMemory like onEdit.
- The inline onUseAction adapter broke MemoryCard memo on every parent
  render; pass a useCallback-stable latest-ref adapter.
- Enter/Space on the feedback buttons bubbled to the card's keydown
  handler and opened the sheet on top of the action; stop keydown
  propagation on the feedback group.
- refreshMemoriesIfNeeded fetched the released projection and committed
  its cursor, which loadMore then paginated as the selected temporal
  view (pages skip/mix). Route the refresh through the device-scope-aware
  funnel so it fetches the selected view and commits its own cursor,
  restoring device-scope handling and the 400 retry it bypassed. Test
  seam via memoriesPageFetch; regression tests assert the refresh
  request carries view=history and commits that response's cursor.
- Remove the never-called getMemoryHistoryPage: the History surface is
  served by getMemoriesPage(view:), already covered by URL contract
  tests.
…ng-beta

# Conflicts:
#	app/lib/l10n/app_ar.arb
#	app/lib/l10n/app_be.arb
#	app/lib/l10n/app_bg.arb
#	app/lib/l10n/app_bn.arb
#	app/lib/l10n/app_bs.arb
#	app/lib/l10n/app_ca.arb
#	app/lib/l10n/app_cs.arb
#	app/lib/l10n/app_da.arb
#	app/lib/l10n/app_de.arb
#	app/lib/l10n/app_el.arb
#	app/lib/l10n/app_en.arb
#	app/lib/l10n/app_es.arb
#	app/lib/l10n/app_et.arb
#	app/lib/l10n/app_fa.arb
#	app/lib/l10n/app_fi.arb
#	app/lib/l10n/app_fr.arb
#	app/lib/l10n/app_he.arb
#	app/lib/l10n/app_hi.arb
#	app/lib/l10n/app_hr.arb
#	app/lib/l10n/app_hu.arb
#	app/lib/l10n/app_id.arb
#	app/lib/l10n/app_it.arb
#	app/lib/l10n/app_ja.arb
#	app/lib/l10n/app_kn.arb
#	app/lib/l10n/app_ko.arb
#	app/lib/l10n/app_localizations.dart
#	app/lib/l10n/app_localizations_ar.dart
#	app/lib/l10n/app_localizations_be.dart
#	app/lib/l10n/app_localizations_bg.dart
#	app/lib/l10n/app_localizations_bn.dart
#	app/lib/l10n/app_localizations_bs.dart
#	app/lib/l10n/app_localizations_ca.dart
#	app/lib/l10n/app_localizations_cs.dart
#	app/lib/l10n/app_localizations_da.dart
#	app/lib/l10n/app_localizations_de.dart
#	app/lib/l10n/app_localizations_el.dart
#	app/lib/l10n/app_localizations_en.dart
#	app/lib/l10n/app_localizations_es.dart
#	app/lib/l10n/app_localizations_et.dart
#	app/lib/l10n/app_localizations_fa.dart
#	app/lib/l10n/app_localizations_fi.dart
#	app/lib/l10n/app_localizations_fr.dart
#	app/lib/l10n/app_localizations_he.dart
#	app/lib/l10n/app_localizations_hi.dart
#	app/lib/l10n/app_localizations_hr.dart
#	app/lib/l10n/app_localizations_hu.dart
#	app/lib/l10n/app_localizations_id.dart
#	app/lib/l10n/app_localizations_it.dart
#	app/lib/l10n/app_localizations_ja.dart
#	app/lib/l10n/app_localizations_kn.dart
#	app/lib/l10n/app_localizations_ko.dart
#	app/lib/l10n/app_localizations_lt.dart
#	app/lib/l10n/app_localizations_lv.dart
#	app/lib/l10n/app_localizations_mk.dart
#	app/lib/l10n/app_localizations_mr.dart
#	app/lib/l10n/app_localizations_ms.dart
#	app/lib/l10n/app_localizations_nl.dart
#	app/lib/l10n/app_localizations_no.dart
#	app/lib/l10n/app_localizations_pl.dart
#	app/lib/l10n/app_localizations_pt.dart
#	app/lib/l10n/app_localizations_ro.dart
#	app/lib/l10n/app_localizations_ru.dart
#	app/lib/l10n/app_localizations_sk.dart
#	app/lib/l10n/app_localizations_sl.dart
#	app/lib/l10n/app_localizations_sr.dart
#	app/lib/l10n/app_localizations_sv.dart
#	app/lib/l10n/app_localizations_ta.dart
#	app/lib/l10n/app_localizations_te.dart
#	app/lib/l10n/app_localizations_th.dart
#	app/lib/l10n/app_localizations_tl.dart
#	app/lib/l10n/app_localizations_tr.dart
#	app/lib/l10n/app_localizations_uk.dart
#	app/lib/l10n/app_localizations_ur.dart
#	app/lib/l10n/app_localizations_vi.dart
#	app/lib/l10n/app_localizations_zh.dart
#	app/lib/l10n/app_lt.arb
#	app/lib/l10n/app_lv.arb
#	app/lib/l10n/app_mk.arb
#	app/lib/l10n/app_mr.arb
#	app/lib/l10n/app_ms.arb
#	app/lib/l10n/app_nl.arb
#	app/lib/l10n/app_no.arb
#	app/lib/l10n/app_pl.arb
#	app/lib/l10n/app_pt.arb
#	app/lib/l10n/app_ro.arb
#	app/lib/l10n/app_ru.arb
#	app/lib/l10n/app_sk.arb
#	app/lib/l10n/app_sl.arb
#	app/lib/l10n/app_sr.arb
#	app/lib/l10n/app_sv.arb
#	app/lib/l10n/app_ta.arb
#	app/lib/l10n/app_te.arb
#	app/lib/l10n/app_th.arb
#	app/lib/l10n/app_tl.arb
#	app/lib/l10n/app_tr.arb
#	app/lib/l10n/app_uk.arb
#	app/lib/l10n/app_ur.arb
#	app/lib/l10n/app_vi.arb
#	app/lib/l10n/app_zh.arb
The app follow-up accidentally committed flutter pub get output, which
stripped plugin packages and left trailing whitespace that fails
diff-hygiene.
Assign the refresh promise through a holder so the finally clause can
drop the single-flight ref without using the binding before initialization.
…lint

The auto-refresh test latched the default-scope sync flag with an inline
forKey string; route it through a local binding like production.
The new view-cursor test polled with Task.sleep, which tripped the
desktop test-quality wall-clock ratchet. Yield until the fetch seam
fires instead.
The main merge dropped the History filter key from app_en.arb, so
flutter gen-l10n deleted the getter across every locale at push time.
The auto-refresh seam was a required closure, so `if let` would not
compile. Keep production on the shared client and let tests replace it.
Mock the data-plane Firestore client in memory-use HTTP tests.
Give pusher capability fixtures a dummy SONIOX_API_KEY.
Add Allow use and Dont use localization keys.
Sync Windows memory view state during render; unwrap the macOS test user id.
The previous setState-in-effect replacement still failed eslint
(Cannot access refs during render). Adjust local snapshot from
state during render when the requested view changes.
The pager issues a follow-up offset request. mockImplementationOnce
let the previous useful-now fixture merge into the history result.
@Git-on-my-level
Git-on-my-level merged commit a22eb2a into main Sep 15, 2026
62 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/memory-forgetting-beta branch September 15, 2026 10:21
Git-on-my-level added a commit that referenced this pull request Sep 23, 2026
…#17301)

Fixes #17296.

## Summary

`POST /v1/dev/user/memories` returns 500 on 20–28% of production calls
with `MemoryFirestoreApplyError: proposed evidence conflicts with
existing evidence identity`.

**Root cause.** Developer API evidence ids are derived from the memory
text, so re-sending the same text reuses one evidence document. #13953
(2026-09-15) added seven capture-metadata fields to `MemoryEvidence`
(`source_signal`, `extractor_id`, `extractor_version`,
`capture_confidence`, `independence_group`, `captured_at`,
`attribution`). The apply-time identity check compared the whole model
minus an exclude list, so those new fields joined the identity
automatically. Evidence written before that release stores them as
absent; every replay of such a source proposes them populated, and the
check reported a conflict for a source that had not changed. The legacy
backfill writes evidence in the same stripped shape.

**Fix.**
- Every `MemoryEvidence` field is classified as identity, metadata, or
state (`models/memory_evidence.py`). The check compares only identity
fields. The fields compared before #13953 stay identity, so no existing
conflict rule is loosened; only the seven capture-metadata fields leave
the comparison, plus `patch_id`/`commit_id` (never set by any writer) as
state.
- A unit test fails when a new field is unclassified, so the next
additive field cannot silently join identity.
- A genuine identity conflict raises `EvidenceIdentityConflict`;
`MemoryService.create_external_memory` and
`create_external_memory_batch` return it as 409 rather than 500. This
covers the developer API, MCP, and `/v3/memories` creates.
- Stored evidence is not rewritten. Absent capture metadata already
means "unknown" (see the `MemoryEvidence` comment), so a backfill would
invent provenance rather than recover it.

No request or response shape changes.

## Verification

- Unit (`backend/test.sh` with `test_memory_apply_store.py`,
`test_memory_service_parity.py`): 64 passed. The two new replay tests
fail against the previous comparison and pass with this change.
- Firestore emulator, real `MemoryService` → canonical adapter → apply
path, developer-API `MemoryDB.from_memory` payloads, evidence rewritten
into the pre-#13953 shape:

| Scenario | `origin/main` 268e04e | this branch |
|---|---|---|
| A: dev-API create, strip evidence metadata, identical re-POST |
`MemoryFirestoreApplyError: proposed evidence conflicts with existing
evidence identity` | ok, same memory id |
| B: MCP create, strip metadata, dev-API POST of the same text | same
error | ok, same memory id |

This reproduces the production exception on real Firestore transaction
semantics and shows the replay is not short-circuited by operation
idempotency.

Follow-up (separate PR, announced breaking change): client
`Idempotency-Key` / `external_id` and server-assigned memory ids for the
developer API, so identity stops depending on text at all.

## Product invariants affected

- INV-MEM-1 — no tier change; the apply path still writes the same
tiers.
- INV-MEM-3 — creates still go through `MemoryService` and the canonical
writer; a conflict now fails closed as 409 instead of 500, with no
fallback writer.
- INV-MEM-4 — intake routing, promotion, and receipts are unchanged;
only the evidence identity comparison inside the apply transaction
changes.

Failure-Class: new

Line-Count-Exception: backend/utils/memory/memory_service.py | 4324 ->
4339 | 409 mapping for evidence identity conflicts at the three
external-create write calls

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/17301?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
piyush295 pushed a commit to piyush295/omi that referenced this pull request Sep 23, 2026
Evidence written before BasedHardware#13953 stores its capture metadata as null, and
the apply-time identity check compared that metadata. Every replay of a
source recorded before that release failed with 'proposed evidence
conflicts with existing evidence identity' and surfaced as a 500 on the
developer memory API (BasedHardware#17296).

Classify every MemoryEvidence field as identity, metadata, or state, and
compare only identity. A test fails on an unclassified field. A genuine
identity conflict now raises a typed error that memory creates return
as 409.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
summersmile1984 added a commit to summersmile1984/omi that referenced this pull request Sep 27, 2026
…6 sync

fork-cloudflare-routes failed in CI at the first step (three RatchetTests
spawning check_projection_names.py, which died with ValueError 'memory
kernel source must be an ordinary repository file'). Root causes, in the
order the lane now hits them:

1. Upstream BasedHardware#18722 (43c27b7, 2026-09-25) deleted
   backend/utils/task_intelligence/rollout.py while MODULES still mapped it
   to candidate_kernel_rollout, so generate() raised before anything ran.
   The projector now stages candidate_kernel_rollout from
   utils/task_intelligence.chat_first_eligibility's pure resolver (the module
   still imports the control table the Worker never stages, so only the node
   is selected), and candidate_control_routes.py performs the endpoint
   projection upstream now does inline in /v1/candidates/control. The new
   staged owner is registered in fork-cloudflare-routes triggers.

2. Upstream a22eb2a (BasedHardware#13953, 2026-09-15) landed four regressions behind
   the then-red lane:
   - Memory.capture_context annotates MemoryCaptureContext; the staged wire
     lacked the class and both Annotation anchors, so every MemoryDB build
     raised PydanticUserError and canonical routes answered 503. The wire
     now selects MemoryCaptureContext and binds Literal/AwareDatetime.
   - read_ledger_history_page gained a provider_kwargs prelude reading
     self.db_client; page_policy drops those statements and fails loudly if
     upstream moves them (NameError -> 503 before the fix).
   - the adapter's scan predicate lazy-imports ledger_history_policy and
     normalize_temporal_read_view; the api-core oracle execs those policy
     modules into its controlled namespace instead of importing
     models.memories -> database._client -> google.
   - belief_computed_at joined the read-time belief overlay; the snapshot
     store's stable_projection excluded only three of upstream's
     BELIEF_VIEW_FIELDS, so belief-on receipts read stale every time. It now
     excludes upstream's own set.

3. Two upstream-inventory ledgers the early failure had masked:
   - backend-routes.json: twenty new slots (MCP canonical root, speaker tag
     prompts, voice profile settings, capture-group separate, local-dev
     token, mobile feedback) recorded as blocked with migration notes under
     a new #cf4-upstream-route-additions-2026-09-26 ledger section; counts
     move 625 -> 645 (602 owned, 43 blocked).
   - redis-primitives.yaml: new family x-sync-window-lock for upstream
     a92d9af's try_acquire_x_sync_window_lock, and three new direct
     callers from the MCP modernization classified.

Evidence (deploy/cloudflare, Node 24.18.0, full lane):
  bash deploy/cloudflare/ci/routes.sh -> exit 0
    test:route-inventory 13 OK; validate:backend-routes 'matches 645';
    validate:manifest '656 CF routes, 645 backend (0 legacy-owned, 43
    blocked)'; tsc clean; vitest 138 files/1157 passed; projection-names
    '10 known unbound; no new ones'; api-core 1299 passed; api-ai 151
    passed.
  check-upstream-touch.py --aggregate exit 0.

Failure-Class: none
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