Skip to content

refactor(core): lift the redaction flag policy out of update_memory_detailed #1520

Closed

Description

@ajianaz

Problem

update_memory_detailed (~200 lines) mixes validation, masking of three inputs, merging redaction counts, a five-arm match that decides which redacted / redactions flags survive each kind of edit, and the re-embed and write. The match is correct (it is covered by tests) but it is a policy table written inline, and it leans on the magic string [REDACTED:.

Direction

Give the flag policy its own module that can be tested without a store, and let update shrink to validate, mask, write.

Behaviour impact

None. The policy table must be preserved exactly (existing tests in privacy_write_tests.rs are the guard).

Acceptance

  • The policy is a pure function with its own tests (no SQLite).
  • update_memory_detailed loses the inline match.

Part of the round-2 deepening epic.

Activity

  1. ajianaz commented on Oct 22, 2026

    @ajianaz
    CollaboratorAuthor

    Done in #1525: the policy is redaction_flags::resolve, a pure function with one test per rule; update_memory_detailed lost its inline match. No behaviour change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions