Skip to content

feat(memory): add pluggable OMS backends - #331

Draft
Sertaç Özercan (sozercan) wants to merge 63 commits into
mainfrom
pluggable-memory
Draft

Sertaç Özercan (sozercan) wants to merge 63 commits into
mainfrom
pluggable-memory

Conversation

@sozercan

@sozercan Sertaç Özercan (sozercan) commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

  • add the namespaced core.orka.ai/v1alpha1 MemoryBackend/default control plane with explicit staged validation, durable authority cutover, routing fences, lifecycle recovery, and fail-closed SQLite behavior
  • add the strict orka.oms.v0alpha1 protocol, public Go protocol/conformance packages, durable reference implementation, operation ledger, bounded pagination, governance/audit state, and matched checkpoint requirements
  • wire remote memory through the public/internal APIs, CLI, controller, AI worker recall path, Helm chart, admission/RBAC policy, generated staging manifests, and provider-neutral release workflows
  • move the provider-specific KD6 adapter, deployment chart, image lifecycle, and live-provider release gate out of tree to orka-agents/orka-oms-kd6-adapter#1

Safety and rollout

  • ships as a default-off foundation artifact that cannot activate remote authority, even when runtime flags or Helm values are forced
  • records feature-epoch history and requires the prior foundation epoch plus compatible live heartbeats before a later activation release can cut over
  • requires a matched, route-bound recovery receipt before activation and never falls back to legacy SQLite after remote authority is active
  • keeps provider credentials, raw provider payloads, and unsafe endpoint identities out of public resources and enforces task-bound Txn-Token scopes on internal memory routes
  • keeps provider-specific transports, credentials, deployment manifests, image publication, and live-provider gates in independent adapter repositories

Verification

  • make manifests
  • make lint-fix
  • DEVELOPER_DIR=/Library/Developer/CommandLineTools make test
  • focused OMS/controller/memory/store tests
  • helm lint manifest_staging/charts/orka
  • go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/helm-chart.yml .github/workflows/release.yml
  • bash -n scripts/*.sh
  • python3 -m py_compile scripts/update-release-version.py
  • Codex autoreview: gpt-5.6-sol, max reasoning — clean
  • Claude autoreview: opus (canonical claude-opus-5), max effort, with CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1; clean Go/release slices, with the sole migration-note suggestion explicitly rejected by Codex because the adapter was never merged, promoted, tagged, or released in-tree

Live KD6 conformance is owned by the out-of-tree adapter release environment because it requires the controlled digest-pinned KD6 test image, credentials, and HTTPS endpoint.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI balanced review requested due to automatic review settings August 1, 2026 03:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 1, 2026 03:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@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: 61198a0709

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread internal/tools/memory_tools.go
Comment thread workers/ai/main.go
Comment thread internal/memory/runner.go Outdated
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 1, 2026 03:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 1, 2026 03:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@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: ce2b1cf93c

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread internal/api/auth.go
Comment thread internal/memory/service.go Outdated
Comment thread internal/memory/service.go Outdated
Comment thread internal/memory/service.go
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 1, 2026 04:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 1, 2026 04:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@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: fa4afb6695

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread internal/store/sqlite/memory_store.go
Comment thread internal/store/sqlite/memory_governance_store.go Outdated
Comment thread internal/memory/service.go Outdated
Comment thread internal/memory/service.go
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 1, 2026 06:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@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

q := u.Query()
if c.Namespace != "" {
if _, ok := query["namespace"]; !ok {
q.Set("namespace", c.Namespace)
}

P2 Badge Preserve namespaces encoded in operation locations

In the orka memory update --file ... --wait path, a manifest namespace may intentionally override the client's configured default namespace, and the server returns that target namespace in the operation Location. When the waiter follows the location with a nil query map, this block overwrites the already-encoded namespace with c.Namespace, so it polls the wrong namespace and typically fails with 404 while the mutation continues. Only inject the client default when neither the path's query nor the supplied query contains a namespace.

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread pkg/oms/protocol/validate.go
Comment thread internal/memory/service.go Outdated
Comment thread internal/oms/kd6adapter/server.go Outdated
Comment thread internal/memory/service.go Outdated
Comment thread internal/api/internal_memory_handlers.go
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 1, 2026 06:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 11:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@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: 76e80d7287

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread internal/memory/service.go Outdated
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 11:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@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: 8a5035e417

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread internal/memory/service.go Outdated
Comment thread internal/memory/service.go
Comment thread internal/memorybackend/manager.go
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 12:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@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: 5f86b91bd9

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread internal/memory/service.go Outdated
Comment thread pkg/oms/conformance/conformance.go
Comment thread internal/memory/service.go
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 13:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@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: 258deac801

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread internal/memory/service.go
Comment thread internal/memory/service.go
Comment thread internal/memory/service.go Outdated
Comment thread internal/memory/oms_client.go Outdated
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@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: 5bbd3f1e80

ℹ️ 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 (@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 (@codex) address that feedback".

Comment on lines +99 to +100
if err := k8sClient.Create(ctx, secret); err != nil {
return nil, fmt.Errorf("creating child transaction token placeholder: %w", err)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reap ownerless token placeholders after cancellation

When the tool context is cancelled after this Secret is created but before the child Task is created or adopts it, cleanup is attempted with the same cancelled context, so its read/delete cannot complete; a worker exit in this window has the same effect. Because the placeholder has no owner reference and there is no placeholder janitor, repeated timed-out delegations permanently accumulate Secrets and can eventually exhaust the namespace's Secret quota. Give placeholders durable expiry-based cleanup or perform cancellation-safe bounded cleanup.

Useful? React with 👍 / 👎.

Comment on lines +2361 to +2364
payload, ownershipCertificate, statusCode, err := doOMSProbeRaw(
ctx, httpClient, target.Endpoint, omsprotocol.PathOwnershipClaim, target.BearerToken, ownershipRequest,
http.StatusOK, http.StatusConflict,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enforce negotiated limits during ownership probes

When a backend advertises a maxRequestBytes smaller than the ownership request or returns an ownership response above maxResponseBytes, ProbeBinding still uses doOMSProbeRaw, which enforces only the protocol-wide hard caps. Fresh evidence after the runtime OMSClient limit fix is that this separate activation path already has the decoded capability limits but does not apply them, so a backend can be claimed and marked ready despite violating its negotiated capacity. Validate the marshaled request and returned payload against the advertised limits before accepting the ownership result.

Useful? React with 👍 / 👎.

if next.ActualMode != first.ActualMode || !next.SnapshotExpiresAt.Equal(first.SnapshotExpiresAt) {
return nil, errors.New("pagination continuation changed snapshot mode or expiry")
}
if err := appendUniqueSnapshotRecords(&result, seenRecords, next.Records); err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enforce advertised snapshot counts in conformance

When an adapter advertises a small maxSnapshotRecords but an auto, semantic, or hybrid probe yields more distinct records across pages, this collector keeps accepting records until the protocol-wide hard page bound. Those probe results are discarded by consumeSearchProbe, so unlike the explicit keyword fixture they are never checked for an exact result set, allowing an adapter that exceeds its advertised snapshot capacity to pass conformance. Reject as soon as the cumulative record count exceeds client.limits.MaxSnapshotRecords.

Useful? React with 👍 / 👎.

Comment on lines +2037 to +2043
if !pageComplete && !request.AllowIncomplete {
memoryIncompleteTotal.Inc()
return nil, &IncompleteSearchError{
Cause: apierror.New(http.StatusServiceUnavailable, ReasonResultSetIncomplete,
"memory search scan budget was exhausted"),
Cursor: cursor,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve partial matches in strict remote continuations

When a strict remote search exhausts the 20-page/candidate budget after finding some eligible items but before filling target, this returns only an error and cursor after saveRemoteSearchContinuation has advanced past every item already accumulated in items. Following the cursor can therefore never return those matches; for example, a valid adapter with maxPageSize=1 and a default 100-result request loses the first 20 matching records on every incomplete attempt. Fresh evidence after the legacy continuation fix is that this remote branch still does not carry undelivered matches into cursor state; persist them for replay before returning the error.

Useful? React with 👍 / 👎.

Comment on lines +783 to +785
if caps.Revision != checkpoint.CapabilitiesRevision {
result.Message = "capability revision changed between prepare and verify"
return result

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Verify capability contents across adapter restart

When an adapter changes an optional capability or advertised limit across restart but reuses the same revision, verification accepts it because the checkpoint records and compares only that string; it then builds fixtures from the new limits. Such an adapter can pass even though the profile requires one revision to identify one effective behavior and configuration. Persist the capability flags and limits in the prepare checkpoint and compare them during verify, excluding the renewable expiry.

Useful? React with 👍 / 👎.

Comment on lines +869 to +872
continuation, err := collectContinuation(ctx, client, checkpoint.PaginationRequest)
if err != nil {
result.Message = err.Error()
return result

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid verifying continuations after their advertised expiry

When an otherwise valid adapter advertises a very short snapshotTtlSeconds such as 1, Prepare checkpoints a page token but verification unconditionally consumes it only after the operator has restarted the adapter. The protocol validator permits any positive TTL, so the snapshot can legitimately expire before VerifyAfterRestart reaches this call, at which point the adapter must reject the expired token and is incorrectly reported as non-conformant. Define a minimum TTL sufficient for the two-phase restart proof or otherwise ensure verification occurs within the advertised lifetime.

Useful? React with 👍 / 👎.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 17:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings August 4, 2026 06:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.

2 participants