Skip to content

fix(authz): repair ownerless migrated memories - #2138

Merged
hidb4ai merged 3 commits into
oceanbase:masterfrom
DongYao0:codex/fix-1677-atomic-memory-ownership
Oct 22, 2026
Merged

hidb4ai merged 3 commits into
oceanbase:masterfrom
DongYao0:codex/fix-1677-atomic-memory-ownership

Conversation

@DongYao0

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #1677.

Rationale for this change

Historical Memory v1 databases can contain committed entry history without a formal per-entry Owner. Enforced access then blocks the entire scope, while the existing offline Atomic Memory migration had no supported way to repair the missing ownership without guessing an identity.

What changes are included in this PR?

  • Add a strict, versioned owner-decision file for operator-attested owner recovery.
  • Refuse enforced migrations when an ownerless entry has neither an explicit decision nor an already-established Atomic Memory Owner.
  • Establish the Atomic Memory Owner in the same transaction as each entry import.
  • Make owner repair idempotent and reject unknown entries, existing formal legacy owners, or conflicting mapped owners.
  • Verify repaired ownership during the offline verify action.
  • Document the English and Chinese recovery workflow.
  • Add CLI, recovery, rerun, and transactional rollback regression coverage.

Are there any user-facing changes?

Yes. powercontext server atomic-memory-migrate now accepts --owner-decisions <file> for plan, apply, and verify. Enforced migrations fail with an actionable diagnostic instead of producing ownerless Atomic Memory entries.

There are no public API, schema, or persisted-format breaking changes. The decision file is an explicit maintenance input and should be retained with the operator's audit record.

How was this change tested?

  • ruff check and ruff format --check on all changed Python files
  • ty check on all changed Python files
  • pytest tests/test_atomic_memory_migration_cli.py tests/e2e/test_atomic_memory_migration_evidence.py tests/e2e/test_atomic_memory_migration_vector.py -q — 55 passed, 62 skipped
  • prek run -a — all repository hooks pass except the known Windows-only ty platform diagnostics for Unix APIs outside this change

AI usage statement

Implemented and verified with OpenAI Codex. AI assistance was used for source tracing, implementation, regression-test design, documentation, and validation; the resulting changes were reviewed locally.

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

LGTM

@AlexStocks AlexStocks added the 1.4.1 v1.4.1 release tracking label Oct 21, 2026
@hidb4ai
hidb4ai merged commit bca678f into oceanbase:master Oct 22, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.4.1 v1.4.1 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(authz): a failed post-write owner step leaves committed entries with no artifact owner, bricking the entire scope with no supported recovery

4 participants